.NET

Reply
Distinguished Contributor
mcicognani
Posts: 124
Registered: ‎12-01-2004
Message 1 of 3 (116 Views)
Accepted Solution

How to access to Mechanical intrinsec layer definition?

116 Views, 2 Replies
05-22-2014 06:50 AM

Hi everybody,

has anyone accessed Mechanical layer definition? I mean, those layer you see through the mechanical layer manager _amlayer as 'definition'. I mean those layer named AM_* that will be used and created as necessary but are still in 'definition' state? Is ther some specific dictionary to look at?

I'd like to access those before they're used and became 'real' layers...

 

This is for Autodesk moderators: will you publish a Mechanical ObjectARX sdk kit for 2015?

 

Regards!

ADN Support Specialist
xiaodong.liang
Posts: 1,262
Registered: ‎06-12-2011
Message 2 of 3 (71 Views)

Re: How to access to Mechanical intrinsec layer definition?

06-04-2014 07:43 PM in reply to: mcicognani

Hi,

 

Could you take a look at the VBA code below if it helps?  It acceses Mechanical layers and change their properties.

 

As to Mechanical SDK, please visit Autodesk Developer Center:

http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=14952981

 

Public Sub mechanicalLayersTest() 

Dim AcmApp As AcadmApplication 
Set AcmApp = Application.GetInterfaceObject("AcadmAuto.AcadmApplication") 

Dim AcmLayerObjectManager As McadLayerObjectMgr 
Set AcmLayerObjectManager = AcmApp.ActiveDocument.LayerObjectMgr 

Dim mSymMgr As McadSymbolBBMgr 
Set mSymMgr = Application.GetInterfaceObject("SymBBAuto.McadSymbolBBMgr") 

Dim Layers As McadLayerCfgs 
Dim Layer As McadLayerCfg 

Set Layers = AcmLayerObjectManager.GetAllLayers _ 
(mSymMgr.StandardMgr.CurrentStandard.ObjectID) 

Dim i As Integer 

For i = 0 To Layers.Count - 1 
Set Layer = Layers(i) 
' Debug.Print Layer.Name 

If Layer.Name = "AM_5" Then 

Debug.Print Layer.Name 
Debug.Print Layer.key 
Debug.Print Layer.Linetype 

Layer.Linetype = "HIDDEN" '"CONTINUOUS" '"CENTER" 

End If 
Next i 

'Make the Layer manager match the setting in the Mechanical layers 
ThisDrawing.SendCommand "AmLayReset " 

End Sub 

 



Xiaodong Liang
Developer Technical Services
Autodesk Developer Network

Distinguished Contributor
mcicognani
Posts: 124
Registered: ‎12-01-2004
Message 3 of 3 (67 Views)

Re: How to access to Mechanical intrinsec layer definition?

06-04-2014 11:12 PM in reply to: xiaodong.liang

Ah! Good place to start! Lot of things to explore!

 

Thank you!

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community