.NET

Reply
*Nate Hunter
Message 1 of 3 (64 Views)

User Selection in Xrefs

64 Views, 2 Replies
02-27-2006 10:31 AM
I have a routine that allows the user to select a door and displays info
about the door (lets say width & height for this example). The user will
sometimes have doors in a xref. How can I still allow him to pick his door
in the xref and display the info from the door. Really all I am looking for
is how to pick the door in the xref. Any Ideas??
Active Contributor
bolek75
Posts: 28
Registered: ‎11-29-2005
Message 2 of 3 (64 Views)

Re: User Selection in Xrefs

03-01-2006 12:45 AM in reply to: *Nate Hunter
Hi Nate,

you have to use filters in my opinion. Try something like this.

public static ObjectId[] FetchAllDorrObjs()
{
Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;


TypedValue[] typeArray = new TypedValue[1];
typeArray[0] = new TypedValue((int) DxfCode.ExtendedDataAsciiString, "Door");

SelectionFilter sf = new SelectionFilter(typeArray);
PromptSelectionResult psr = ed.SelectAll(sf);

try
{
SelectionSet ss = psr.Value;
return ss.GetObjectIds();
}
catch (System.Exception)
{
return null;
}
}
*Nate Hunter
Message 3 of 3 (64 Views)

Re: User Selection in Xrefs

03-01-2006 01:09 PM in reply to: *Nate Hunter
ok you confused me. I want to do the same thing when I user selects a door
that is in a reference. Not all doors are going to be extracted just one
door the user selects. Here is what I have for a current drawing:

Here is what I have so far:

Dim ReturnObj As Object

Dim basePnt As Object

Dim Door As AecDoor

Dim dbWidth As Double

Dim dbHeight As Double



ThisDrawing.Utility.GetEntity(ReturnObj, basePnt, "Select the Door to Tag!")

Door = ReturnObj

dbWidth = Door.Width

dbHeight = Door.Height





wrote in message news:5098551@discussion.autodesk.com...
Hi Nate,

you have to use filters in my opinion. Try something like this.

public static ObjectId[] FetchAllDorrObjs()
{
Editor ed =
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;


TypedValue[] typeArray = new TypedValue[1];
typeArray[0] = new TypedValue((int) DxfCode.ExtendedDataAsciiString,
"Door");

SelectionFilter sf = new SelectionFilter(typeArray);
PromptSelectionResult psr = ed.SelectAll(sf);

try
{
SelectionSet ss = psr.Value;
return ss.GetObjectIds();
}
catch (System.Exception)
{
return null;
}
}
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.