.NET

Reply
*Tony Tanzillo
Message 11 of 13 (87 Views)

Re: .NET and Autocad versions...

06-10-2005 02:00 AM in reply to: *Anders Pettersson
BTW, you might want to know that it isn't necessary to
deal with the result of calling the ActiveX Select() method,
as your (disassembled) code below does.

Any call to acedSSGet() which produces a valid selection set,
causes that selection set becoming the Previous selection set.

Hence, all you have to do is call the AcadSelectionSet.Select()
method and if it succeeds, you can get the resulting selection
set via Editor.SelectPrevious(), and you then have a managed
SelectionSet to work with. So, don't bother with returning an
ObjectIdCollection. Instead, declare your function's retun type
as PromptSelectionResult, and call Editor.SelectPrevious(), and
just return its result.

public static ObjectIdCollection SelectAll(TypedValue[] filter)
{
int num1 = filter.Length;
short[] numArray1 = new short[num1];
object[] objArray1 = new object[num1];
for (int num2 = 0; num2 < num1; num2++)
{
numArray1[num2] = filter[num2].TypeCode;
objArray1[num2] = filter[num2].Value;
}
AcadDocument document1 = (AcadDocument) Application.DocumentManager.MdiActiveDocument.AcadDocument;
AcadSelectionSet set1 = document1.get_SelectionSets().Add("temp");
set1.Select(5, Type.Missing, Type.Missing, numArray1, objArray1);
int num4 = set1.get_Count();
Tools.Editor.WriteMessage(num4.ToString() + " objects have been selected.");
ObjectIdCollection collection1 = new ObjectIdCollection();
for (int num3 = 0; num3 < set1.get_Count(); num3++)
{
collection1.Add(DBObject.FromAcadObject(set1.Item(num3)));
}
set1.Delete();
return collection1;
}

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

wrote in message news:4871213@discussion.autodesk.com...
But you can not use conditinal selectionset.For example,I cannot select both circles or lines with Getselection.

3. I'd like to think that the .NET API does a better job at usability than
the C++ API. Compare acedSSGet to the various GetSelection methods. Or the
ease of creating a palette using the .NET API vs. using AcUi/AdUi.

Albert
*Paul Richardson
Message 12 of 13 (87 Views)

Re: .NET and Autocad versions...

06-10-2005 08:12 AM in reply to: *Anders Pettersson
informative thread Gentlemen, Thanks.
"Tony Tanzillo" wrote in message
news:4871326@discussion.autodesk.com...
BTW, you might want to know that it isn't necessary to
deal with the result of calling the ActiveX Select() method,
as your (disassembled) code below does.

Any call to acedSSGet() which produces a valid selection set,
causes that selection set becoming the Previous selection set.

Hence, all you have to do is call the AcadSelectionSet.Select()
method and if it succeeds, you can get the resulting selection
set via Editor.SelectPrevious(), and you then have a managed
SelectionSet to work with. So, don't bother with returning an
ObjectIdCollection. Instead, declare your function's retun type
as PromptSelectionResult, and call Editor.SelectPrevious(), and
just return its result.

public static ObjectIdCollection SelectAll(TypedValue[] filter)
{
int num1 = filter.Length;
short[] numArray1 = new short[num1];
object[] objArray1 = new object[num1];
for (int num2 = 0; num2 < num1; num2++)
{
numArray1[num2] = filter[num2].TypeCode;
objArray1[num2] = filter[num2].Value;
}
AcadDocument document1 = (AcadDocument)
Application.DocumentManager.MdiActiveDocument.AcadDocument;
AcadSelectionSet set1 = document1.get_SelectionSets().Add("temp");
set1.Select(5, Type.Missing, Type.Missing, numArray1, objArray1);
int num4 = set1.get_Count();
Tools.Editor.WriteMessage(num4.ToString() + " objects have been
selected.");
ObjectIdCollection collection1 = new ObjectIdCollection();
for (int num3 = 0; num3 < set1.get_Count(); num3++)
{
collection1.Add(DBObject.FromAcadObject(set1.Item(num3)));
}
set1.Delete();
return collection1;
}

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

wrote in message news:4871213@discussion.autodesk.com...
But you can not use conditinal selectionset.For example,I cannot select both
circles or lines with Getselection.

3. I'd like to think that the .NET API does a better job at usability than
the C++ API. Compare acedSSGet to the various GetSelection methods. Or the
ease of creating a palette using the .NET API vs. using AcUi/AdUi.

Albert
Valued Contributor
aslam
Posts: 86
Registered: ‎07-22-2006
Message 13 of 13 (87 Views)

Re: .NET and Autocad versions...

02-08-2007 10:47 PM in reply to: *Anders Pettersson
Hi all,
I need to know how can i access property palette of Autocad and show a property of given Autocad Object through propgramming.
Thanks..
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.