AutoCAD Mechanical Forum
Welcome to Autodesk’s AutoCAD Mechanical Forums. Share your knowledge, ask questions, and explore popular AutoCAD Mechanical topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Layer Group

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
391 Views, 4 Replies

Layer Group

How can i to aad Layer Group in vba
Autocad Mechanical 6
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

If you don't get a response here you may want to try posting VBA questions to the
autocad.customization.vba newsgroup instead. Even though it is a Mechanical specific
question many things are very similar to regular AutoCad.

You can find it using the appropriate link below.

Newsreader
news://discussion.autodesk.com/autodesk.autocad.customization.vba
Web
http://discussion.autodesk.com/WebX?14@@.ee77f0d


--
Kent
Assistant Moderator
Autodesk Discussion Forum Moderator Program


"LHGO" wrote in message news:f16411a.-1@WebX.maYIadrTaRb...
> How can i to aad Layer Group in vba
> Autocad Mechanical 6
>
>
Message 3 of 5
Anonymous
in reply to: Anonymous

I believe the only function that can currently create layer groups is the
function, "MoveLayerGroupEntities," in the mcadauto api. It requires that
you have a preexisting "source group." The entities on this group will be
moved to the "target group." If the target group doesn't already exist, it
will be created.

Unfortunately, I don't believe there is currently a way to create layer
groups from scratch in the API.

I hope this helps,

Jason Vaughn
AcadM Developer


"LHGO" wrote in message
news:f16411a.-1@WebX.maYIadrTaRb...
> How can i to aad Layer Group in vba
> Autocad Mechanical 6
>
>
Message 4 of 5
Anonymous
in reply to: Anonymous

New Layer groups can be created by simply making a new layer with the appropriate format. As it was explained to me, layer groups are nothing more that specifically named layers that are referenced by code running on top of acad.
Create the layer "anything-AM_0" and you now have the "anything" layer group.
Message 5 of 5
FRFR1426
in reply to: Anonymous

You have to use the method IMcadLayerObjectMgr::CreateLayer :

 

Public Sub CreateLayerGrp()
  Dim acmApp As AcadmApplication
  Set acmApp = ThisDrawing.Application.GetInterfaceObject("AcadmAuto.AcadmApplication")
  acmApp.ActiveDocument.LayerObjectMgr.CreateLayer "MY_LAYER", "MY_GROUP"
End Sub

 

Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr

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

Post to forums  

Autodesk Design & Make Report

”Boost