'This software or file (the “Material”) contains trade secrets or otherwise confidential information owned by Siemens Industry Software Inc. or its affiliates (collectively, “SISW”), or SISW’s licensors. Access to and use of this 'information is strictly limited as set forth in one or more applicable agreement(s) with SISW. This Material may not be copied, distributed, or otherwise disclosed without the express written permission of SISW, and may not be 'used in any way not expressly authorized by SISW. ' ' 'Unless otherwise agreed in writing, SISW has no obligation to support or otherwise maintain this Material. No representation or other affirmation of fact herein shall be deemed to be a warranty or give rise to any liability of 'SISW whatsoever. ' ' 'SISW reserves the right to make changes in specifications and other information contained herein without prior notice, and the reader should, in all cases, consult SISW to determine whether any changes have been made. ' ' 'SISW MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THIS MATERIAL INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT OF INTELLECTUAL PROPERTY. SISW SHALL 'NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL OR PUNITIVE DAMAGES, LOST DATA OR PROFITS, EVEN IF SUCH DAMAGES WERE FORESEEABLE, ARISING OUT OF OR RELATED TO THIS PUBLICATION OR THE INFORMATION CONTAINED IN IT, 'EVEN IF SISW HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. ' ' 'TRADEMARKS: The trademarks, logos, and service marks (collectively, “Marks”) used herein are the property of Siemens AG, SISW, or their affiliates (collectively, “Siemens”) or other parties. No one is permitted to use these Marks 'without the prior written consent of Siemens or the owner of the Marks, as applicable. The use herein of third party Marks is not an attempt to indicate Siemens as a source of a product, but is intended to indicate a product 'from, or associated with, a particular third party. A list of Siemens’ Marks may be viewed at: www.plm.automation.siemens.com/global/en/legal/trademarks.html 'Declare empty arrays Dim ListDrawingsAtCombo$() Dim strLastSelectedDrawing$ Sub Main 'Allocate arrays Drawings ReDim ListDrawingsAtCombo(ActiveDocument.Drawings.Count) index = 0 'Iterate through all Drawings in the database and fill array of names For Each nextDrawing In ActiveDocument.Drawings ListDrawingsAtCombo(index) = nextDrawing.Name index = index + 1 Next nextDrawing strLastSelectedDrawing = "" Begin Dialog UserDialog 590,350,"Drawing Item Selector",.DialogFunc ' %GRID:10,7,1,1 GroupBox 10,7,540,245,"",.GroupBox2 Text 20,14,90,14,"Drawings:" Text 410,42,130,42,"Select item from combobox OR type drawing name." GroupBox 10,259,400,63,"",.GroupBox1 CancelButton 220,280,120,21 ' OKButton 30,280,60,21 ComboBox 30,28,360,196,ListDrawingsAtCombo(),.ComboBox1 Text 380,273,180,56,"Select a drawing and click Select.",.Text1 PushButton 60,280,90,21,"&Select" End Dialog Dim dlg As UserDialog If Dialog(dlg) = 0 Then 'CANCEL was pressed End If End Sub Function DialogFunc%(DlgItem$, Action%, SuppValue%) Debug.Print "Action=";Action% If DlgItem <> "" Then Debug.Print DlgItem$;"=""";DlgText$(DlgItem$);"""" End If Debug.Print "SuppValue=";SuppValue% Select Case Action% Case 2 ' Value changing or button pressed If DlgItem$ = "Select" Then 'Unselect all objects ActiveDocument.SelectObjects(ppcbObjectTypeAll, "", False) 'Select drawing by given name ActiveDocument.SelectObjects(ppcbObjectTypeDrawing, strLastSelectedDrawing, True) View.SetExtentsToSelection DialogFunc% = True 'Do not exit the dialog End If Case 3 ' TextBox or ComboBox text changed If DlgItem$ = "ComboBox1" Then strLastSelectedDrawing = DlgText$(DlgItem$) View.SetExtentsToSelection ' MsgBox strLastSelectedDrawing End If End Select End Function