How to change settings in snap dialog by Revit API?

How to change settings in snap dialog by Revit API?

Anonymous
Not applicable
1,528 Views
3 Replies
Message 1 of 4

How to change settings in snap dialog by Revit API?

Anonymous
Not applicable

Hello,

in Revit's ribbon [Manage] - [Snaps] dialog, I want to uncheck the two options: [snap to remote objects ], [snap to point clouds ]. How to do it by Revit API?

QQ截图20180907103810.png

0 Likes
1,529 Views
3 Replies
Replies (3)
Message 2 of 4

FaustoMendezcom
Enthusiast
Enthusiast

I can only think in 2 ways of doing it one is using PostCommand with the Windows Automation API.

 

 

public void PostableCommandExample()
{
UIDocument uidoc = this.ActiveUIDocument;
Document doc = uidoc.Document;
 View view = doc.ActiveView; 
uidoc.Application.PostCommand(RevitCommandId.LookupCommandId("Dialog_Essentials_SnapIncrements"));
}

 

Some resources:

https://thebuildingcoder.typepad.com/blog/2013/10/programmatic-custom-add-in-external-command-launch...

 https://thebuildingcoder.typepad.com/blog/win32/

https://thebuildingcoder.typepad.com/blog/2017/12/magic-number-magic-automation-and-magic-season.htm...

 

and the other one using Revit Journal playback.

 

 Jrn.RibbonEvent "TabActivated:Manage"
 Jrn.Command "Ribbon" , "Modify snap distances or angles , ID_SETTINGS_SNAPPING"
  Jrn.CheckBox "Modal , Snaps , Dialog_Essentials_SnapIncrements" _
         , "Snap to Remote Objects, Control_Essentials_SnapDialogRemote" _
         , False
 Jrn.CheckBox "Modal , Snaps , Dialog_Essentials_SnapIncrements" _
         , "Snap to Point Clouds, Control_Essentials_SnapDialogPointClouds" _
         , False
 Jrn.PushButton "Modal , Snaps , Dialog_Essentials_SnapIncrements" _
         , "OK, IDOK"

 

 

some resources :

https://thebuildingcoder.typepad.com/blog/2009/07/journal-file-replay.html

https://forums.autodesk.com/t5/revit-ideas/journal-record-and-play/idi-p/7399668

 

Hope it helps 🙂

Hope it helps 🙂
-------------------------------------------------------------------------------------
www.faustomendez.com
0 Likes
Message 3 of 4

JimJia
Alumni
Alumni

I am sorry to say that there is currently no straightforward Revit API access to this functionality.

You may have to use Windows API to achieve your desired requirement.

 

Besides, You're recommended to post this request in vote forum below:
http://forums.autodesk.com/t5/revit-ideas/idb-p/302/tab/most-recent

 

This issue is important to me. What can I do to help?


This issue needs to be assessed by our engineering team, and prioritized against all of the other change requests that are outstanding. As a result any information that you can provide to influence this assessment will help. Please provide the following where possible:
• Impact on your application and/or your development.
• The number of users affected.
• The potential revenue impact to you.
• The potential revenue impact to Autodesk.
• Realistic timescale over which a fix would help you.
• In the case of a request for a new feature or a feature enhancement, please also provide detailed Use Cases for the workflows that this change would address.


This information is extremely important. Our engineering team have limited resources, and so must focus their efforts on the highest impact Change Requests. We do understand that this will cause you delays and affect your development planning, and we appreciate your cooperation and patience.

 


Jim Jia
Autodesk Forge Evangelist
https://forge.autodesk.com
Developer Technical Services
Autodesk Developer Network
Email: [email protected]
0 Likes
Message 4 of 4

Anonymous
Not applicable

Hi  

 

 

 

Best Regards,

0 Likes