Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Mcad2DSPreview control in AutoCAD Mechanical 2014 VBA

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
RANJANSUPERMAN
354 Views, 3 Replies

Mcad2DSPreview control in AutoCAD Mechanical 2014 VBA

Hi,

 

Could you please help me in using Mcad2DSPreview Control in Autocad Mechanical 2014 VBA. I couldn't find any documentation regarding this.

 

~Ranjan

Tags (4)
3 REPLIES 3
Message 2 of 4

Hi,

 

sorry to say, you landed in the wrong forum, here is not Mechanical and here is also not VBA handled.

Maybe you have more luck using that forums:

>>>AutoCAD Mechanical<<<

>>>Visual Basic Customization<<<

 

Good luck, - alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 3 of 4

Hi,

 

Please post in the right forum next time ; Below is code that you were looking for. 

 

' 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(0).ComponentViewDefinitions(0).Name
acmFoldDesc.Definition = acmCompDefs(0).ComponentViewDefinitions(0)

' assign it to the preview component
Mcad2DSPreview1.Descriptor = acmFoldDesc

Message 4 of 4

 

Thank you very much for not making me to wait more time for solution.

 

I might have lost some more time by moving this query to the relevent forum.

 

I apprciate your time and help. 

 

Great!

 

I wish I could be able to give you more Kudos ...!!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost