How to access to Mechanical intrinsec layer definition?

How to access to Mechanical intrinsec layer definition?

Anonymous
Not applicable
972 Views
2 Replies
Message 1 of 3

How to access to Mechanical intrinsec layer definition?

Anonymous
Not applicable

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!

0 Likes
Accepted solutions (1)
973 Views
2 Replies
Replies (2)
Message 2 of 3

xiaodong_liang
Autodesk Support
Autodesk Support
Accepted solution

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 

 

0 Likes
Message 3 of 3

Anonymous
Not applicable

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

 

Thank you!

0 Likes