API Access to Linework Tool?

API Access to Linework Tool?

mfleming.stantec
Enthusiast Enthusiast
2,598 Views
2 Replies
Message 1 of 3

API Access to Linework Tool?

mfleming.stantec
Enthusiast
Enthusiast

Hi,

 

I'm looking to build a very simple tool that will reset all linework done it the current view.

The Linework command under modify is what I'm referring to.

 

Looking at the API.chm, Linework is part of the PostableCommand Enumeration.

 

Anyone have examples on how one would use this?

 

I'm thinking I would have to use some kind of PickLine function to pick all the lines in the current view, then change the override back to "ByCategory" to "reset" the view.

 

Matt

0 Likes
Accepted solutions (1)
2,599 Views
2 Replies
Replies (2)
Message 2 of 3

jeremytammik
Autodesk
Autodesk
Accepted solution

Dear Matt,

 

Thank you for your query.

 

If you use PostCommand to launch a built-in Revit command, it will always run the full command with its normal user interface, afaik.

 

In other words, there is no way that I am aware of to specify what elements it should process and exactly what to do with them.

 

The built-in command will prompt the user for that information in its normal fashion.

 

Another approach might be to analyse exactly what database changes are made by the original linework command, and reset those specifically to their default state.

 

I have described how to analyse the 'before' and 'after' states a couple of times:

 

http://thebuildingcoder.typepad.com/blog/2017/01/virtues-of-reproduction-research-mep-settings-ontol...

 

I find BipChecker and the element lister especially useful for this task.

 

I hope this helps.

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 3

lionel.kai
Advisor
Advisor

I posted an Idea for this requested functionality here:

 

API access to Linework tool (get and set edge/line overrides) - Autodesk Community


Lionel J. Camara
BIM Manager at KAI Hawaii, Inc. - Structural and Forensic Engineers
Autodesk Certified Professional
0 Likes