How does ObjectSnapTypes.Perpendicular work?

How does ObjectSnapTypes.Perpendicular work?

Kevin.Bell
Advisor Advisor
532 Views
2 Replies
Message 1 of 3

How does ObjectSnapTypes.Perpendicular work?

Kevin.Bell
Advisor
Advisor

Hi,

 

I'd like to understand how ObjectSnapTypes.Perpendicular and ObjectSnapTypes.Quadrants work.

 

I assumed that to get these to work the user would have to pick a point and then the snap would work when the user selects the second point.

 

But I can't see any way of passing the first point to the ObjectSnapType class. I've tried this:

 

XYZ p1 = uidoc.Selection.PickPoint(ObjectSnapTypes.None);

XYZ p2 = uidoc.Selection.PickPoint(ObjectSnapTypes.Perpendicular);

TaskDialog.Show("Message", p1.ToString() + "\n\n" + p2.ToString());

 

 

But the snaps don't work.

 

Is there something I should be doing first?

 

Thanks.

0 Likes
533 Views
2 Replies
Replies (2)
Message 2 of 3

so-chong
Advocate
Advocate

Hi,

Did you find this on the Revit API Docs?

 

http://www.revitapidocs.com/2018/af8ad302-7196-8e2f-f1eb-e5929cda30d9.htm?section=exampleToggle

 

Hope this helps!

 

0 Likes
Message 3 of 3

Kevin.Bell
Advisor
Advisor

yea, I've seen that (I have the SDK installed).

 

That shows PickPoint(snapsetting, prompt)...

 

The issue I have is that to snap 'Perpendicular' the user has to pick a point first... i.e. you can only snap perpendicular from a previous point.

I can't see any way of passing the previous point to the command... Unless I've missing something or misunderstanding what ObjectSnapTypes.Perpendicular does...

 

Cheers,

0 Likes