.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

User Selection in Xrefs

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
250 Views, 2 Replies

User Selection in Xrefs

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??
2 REPLIES 2
Message 2 of 3
bolek75
in reply to: Anonymous

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;
}
}
Message 3 of 3
Anonymous
in reply to: Anonymous

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;
}
}

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