.NET
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
*Tony Tanzillo
Re: .NET and Autocad versions.. .
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
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.Acad Document;
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
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.Acad
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(
}
set1.Delete();
return collection1;
}
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.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
Re: .NET and Autocad versions.. .
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
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.Acad Document;
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
"Tony Tanzillo"
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.Acad
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(
}
set1.Delete();
return collection1;
}
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.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
Re: .NET and Autocad versions.. .
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
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..
I need to know how can i access property palette of Autocad and show a property of given Autocad Object through propgramming.
Thanks..



