.NET

Reply
New Member
DenisLebedev
Posts: 1
Registered: ‎06-01-2011
Message 1 of 4 (1,079 Views)
Accepted Solution

Select all object in the drawing

1079 Views, 3 Replies
06-01-2011 01:08 PM

Hello,

 

How can I select all the objects (lines, plylines, etc) in the drawing using C# + AutoCad?

 

AcadSelectionSet select = _acadCurrentDocument.SelectionSets.Add("my");

select.Select(AcSelect.acSelectionSetAll);

 Trying to modify this coede, but something is missing.

If you using AcadInterop so try this code snip:

 AcadSelectionSet oSset = doc.SelectionSets.Add("my");
//using filter
object miss = Type.Missing;
short[] dxfcode= new short[]{0};
object[] dxfvalue= new object[]{"line,polyline,circle,ellipse,text,insert"};
oSset.Select(AcSelect.acSelectionSetAll, miss, miss, dxfcode as object, dxfvalue as object);
//send message to command line:
doc.Utility.Prompt(string.Format("\nSelected: {0} objects", oSset.Count));

 

 

~'J'~

Mentor
BrentBurgess1980
Posts: 165
Registered: ‎06-16-2008
Message 2 of 4 (1,062 Views)

Re: Select all object in the drawing

06-01-2011 03:05 PM in reply to: DenisLebedev
I haven't got ACAD on this computer, so I can't verify the exactness of the code, but look at the editor and the PromptSelectionOptions and PromptSelctionResult
*Expert Elite*
Hallex
Posts: 1,569
Registered: ‎10-08-2008
Message 3 of 4 (1,059 Views)

Re: Select all object in the drawing

06-01-2011 03:08 PM in reply to: DenisLebedev

If you using AcadInterop so try this code snip:

    AcadSelectionSet oSset = doc.SelectionSets.Add("my");                
                //using filter
                object miss = Type.Missing;
                short[] dxfcode= new short[]{0};
                object[] dxfvalue= new object[]{"line,polyline,circle,ellipse,text,insert"};

                oSset.Select(AcSelect.acSelectionSetAll, miss, miss, dxfcode as object, dxfvalue as object);
                //send  message to command line:
                doc.Utility.Prompt(string.Format("\nSelected: {0} objects", oSset.Count));

 

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Mentor
amitk_189
Posts: 242
Registered: ‎12-15-2011
Message 4 of 4 (742 Views)

Re: Select all object in the drawing

07-24-2012 04:25 AM in reply to: DenisLebedev

But i am using Standard EXE and how does select all work in  my case and get the texts with Origins

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.