|
|
Home | Forums |
Downloads | Gallery |
News & Articles | Resources |
Jobs | FAQ |
| Join |
Welcome !
|
44 Users Online (43 Members):
Show Users Online
- Most ever was 626 - Mon, Jan 12, 2015 at 2:00:17 PM |
Forums
Forums >> Workflow & Implementation >> API & Third Party Apps >> ISelectionFilter for CADLinkTypes
|
|
active
Joined: Thu, Sep 13, 2007
63 Posts
|
Hopefully I'm going about this the right way but with no sucess, I'm trying to make an ISelectionFilter to only allow picking of CAD files in a project. I've also tried using the CADLinkType class. My code so far is:
public class CADPickFilter : ISelectionFilter { public bool AllowElement (Element e) { if (e.Name.EndsWith(".dwg")) { return true; } return false; } public bool AllowReference (Reference r, XYZ p) { return false; } }
Thanks for any help.
|
This user is offline |
|
|
|
active
Joined: Thu, Sep 13, 2007
63 Posts
|
I'll try again to make it more readable:
public bool AllowElement (Element e)
{
if (e.Name.EndsWith(".dwg"))
{
return true;
}
return false;
}
public bool AllowReference (Reference r, XYZ p)
{
return false;
}
}
|
This user is offline |
|
|
active
Joined: Tue, Mar 5, 2013
1 Posts
|
Try using RevitLookup to determine what properties you can use to filter the object.
It's part of the SDK and allows you to inspect elements that are currently selected. You'll be able to determine a class, category, or some other property that you'll be able to use for filtering.
|
This user is offline |
|
|
active
Joined: Thu, Sep 13, 2007
63 Posts
|
Thanks so much! Should have thought of that before. I changed it to:
if (e.Category.Name.EndsWith(".dwg"))
and now it works as I wanted it to.
|
This user is offline |
|
|
|
|
Site Stats
Members: | 2064312 | Objects: | 23084 | Forum Posts: | 152250 | Job Listings: | 3 |
|