§Private
Sub ShowButton_Click()
§ ' get
mechanical application object
§ Dim acmApp As AcadmApplication
§ Set acmApp =
ThisDrawing.Application.GetInterfaceObject("AcadmAuto.AcadmApplication")
§
§ ' get the 2D
structure manager object
§ Dim acmStrMgr As Mcad2DStructureMgr
§ Set acmStrMgr =
acmApp.ActiveDocument.StructureMgr2D
§
§ ' get all
component definitions
§ Dim acmCompDefs As McadComponentDefinitions
§ Call acmStrMgr.GetComponentDefinitions(acmCompDefs,
False)
§
§ ' create a
folder descriptor
§ Dim acmFoldDesc
As McadFolderDescriptor
§ Set acmFoldDesc
= acmStrMgr.CreateFolderDescriptor
§
§ ' set it to
the folder descriptor
§ acmFoldDesc.Name
= acmCompDefs(1).ComponentViewDefinitions(0).Name
§ acmFoldDesc.Definition =
acmCompDefs(1).ComponentViewDefinitions(0)
§
§ ' assign it
to the preview component
§ Mcad2DSPreview1.Descriptor
= acmFoldDesc
§End
Sub