.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to access to Mechanical intrinsec layer definition?

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
mcicognani
640 Views, 2 Replies

How to access to Mechanical intrinsec layer definition?

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!

2 REPLIES 2
Message 2 of 3
xiaodong_liang
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 

 

Message 3 of 3
mcicognani
in reply to: xiaodong_liang

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

 

Thank you!

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost