.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 2
Anonymous
172 Views, 1 Reply

Need help

Hi all,

I need to "translate" from script code to managed .NET.
In few words, I want to insert into another dwg all acadEntities which don't
have a specific layer(s).

// turning On only the specific layers (CON + CONT)
_LAYER _OFF * _Y
_LAYER _ON CON
_LAYER _ON CONT
_LAYER _SET CONT
// I'm deleting all the entities with Layer = CON/CONT
_ERASE _W -10000.000000,-10000.000000 10000.000000,10000.000000
_LAYER _ON *
_LAYER _S 0
_QTEXTMODE 0
_WBLOCK "My.dwg" _Y 0.000000,0.000000 _W -10000.000000,-10000.000000
10000.000000,10000.000000

Now, in C# I'm enumerating through all AcadEntities and check the Layer
property (foreach AcadEntity in AcadDocument.ModelSpace.Entities ...), BUT
it takes too much.
Maybe you'll point me in the right direction.

Thanks for any advice
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Anonymous

Create a SelectionSet with filter set to the layer(s). With
Autodesk.AutoCAD.EditorInput.Editor object, there are quite a few methods:
GetSelection(), SelectAll(), SelectXXXXXX()..... Once you get the entities
into a SelectionSet, you can easily do whatever you want to do to these
entities.

"Bragadiru" wrote in message
news:5375398@discussion.autodesk.com...
Hi all,

I need to "translate" from script code to managed .NET.
In few words, I want to insert into another dwg all acadEntities which don't
have a specific layer(s).

// turning On only the specific layers (CON + CONT)
_LAYER _OFF * _Y
_LAYER _ON CON
_LAYER _ON CONT
_LAYER _SET CONT
// I'm deleting all the entities with Layer = CON/CONT
_ERASE _W -10000.000000,-10000.000000 10000.000000,10000.000000
_LAYER _ON *
_LAYER _S 0
_QTEXTMODE 0
_WBLOCK "My.dwg" _Y 0.000000,0.000000 _W -10000.000000,-10000.000000
10000.000000,10000.000000

Now, in C# I'm enumerating through all AcadEntities and check the Layer
property (foreach AcadEntity in AcadDocument.ModelSpace.Entities ...), BUT
it takes too much.
Maybe you'll point me in the right direction.

Thanks for any advice

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