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?
Solved! Go to Solution.
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:
Public Sub mechanicalLayersTest() Dim AcmApp As AcadmApplication Set AcmApp = Application.GetInterfaceObject("AcadmAuto.AcadmApp
lication") Dim AcmLayerObjectManager As McadLayerObjectMgr Set AcmLayerObjectManager = AcmApp.ActiveDocument.LayerObjectMgr Dim mSymMgr As McadSymbolBBMgr Set mSymMgr = Application.GetInterfaceObject("SymBBAuto.McadSymb olBBMgr") 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