Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is there a way to adjust a witness line gap?

20 REPLIES 20
Reply
Message 1 of 21
Anonymous
2443 Views, 20 Replies

Is there a way to adjust a witness line gap?

 

 

 

Hi.

I'm sorry to post duplicate question, but I can not solve and try to upload again.

 

I want to adjust dimension's end point.

I created dimensions as follows. 

 

ReferenceArray refArray = new ReferenceArray();
refArray.Append(startLine.Reference);
refArray.Append(endLine.Reference);

...

var line = Line.CreateBound(point1, point2); Dimension dimension = doc.Create.NewDimension(view, line, refArray);

image.png 

 

and I want the end point to be automatically adjusted using api. (like red line)

image.png

 

like this

image.png

I have found on the Internet and used Dimension.Segments, but the number of values was 0.

 

is there a way? I need help.

 

thank you!

20 REPLIES 20
Message 2 of 21
jeremytammik
in reply to: Anonymous

I am checking with the development team for you. Hang on...

 



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

Message 3 of 21
Anonymous
in reply to: jeremytammik

@jeremytammik

ok, thanks!

I'll be waitingSmiley Happy

Message 4 of 21
Anonymous
in reply to: jeremytammik

Hi @jeremytammik

I am waiting for your reply!

Is there no way?

Message 5 of 21
jeremytammik
in reply to: Anonymous

No reply yet...

 



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

Message 6 of 21
Anonymous
in reply to: jeremytammik

@jeremytammik

ok! please let me know if you get an answer.

thank you so much!!!

Message 7 of 21
lloyolaRLE
in reply to: jeremytammik

Is there any clue? I would be very grateful,  my development is also stucked on this issue. 

 

Regards 

Message 8 of 21
jeremytammik
in reply to: Anonymous

Sorry that there is still no answer to this.

 

I re-prompted the development team for one.

 

Meanwhile, a question for you:

 

Can you achieve the desired adjustment manually in the user interface?

 

Please be aware that the Revit API hardly ever supports any functionality that is not also available in the user interface.

 

Therefore, the standard approach to research and develop an API based solution consists of making the desired modification manually in the user interface and using RevitLookup or other means to determine the exact database changes reflecting the modification.

 

Once that is understood, we can explore how to achieve the same result programmatically.

 

Check out this description of how to research to find a Revit API solution:

  

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

 

Cheers,

 

Jeremy

 

 

 



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

Message 9 of 21
Anonymous
in reply to: jeremytammik

Hello @jeremytammik

 

I'm constantly following this topic because I have a similar issue.

 

https://forums.autodesk.com/t5/revit-api-forum/rebar-dimensions-witness/td-p/8417516

 

According to your question, at least for my case, it is possible to adjust it manually in Revit but my routine is creating hundreds of dimensions which manually correcting them could be an unviable/non-productive procedure.

 

Any tip of advice will be very well received.

 

Best regards

Message 10 of 21
Anonymous
in reply to: Anonymous

Any word on this topic yet?  Do we know if this is possible in Revit API?

Message 11 of 21
jeremytammik
in reply to: Anonymous

Sorry for the continued lack of response... I re-prompted, once again... 

 



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

Message 12 of 21
Anonymous
in reply to: jeremytammik

Great, thanks for doing that, Jeremy!  Let me know if you hear anything.  Not urgent or anything.  I was just investigating my options.

Message 13 of 21
jeremytammik
in reply to: Anonymous

The development team replied and says:

 

Sorry for the late reply because I am still in my vacation now.

 
The witness line geometry could be retrieved by Dimension.References, but it is a simple geometry object but no other extra infos such as gaps.

 

The dimension type should contain some of that data, such as the built-in parameter WITNS_LINE_GAP_TO_ELT and WITNS_LINE_EXTENSION.

 

This might not resolve all the problems, but should work in some specific cases.

 

Cheers,

 

Jeremy

 



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

Message 14 of 21
Anonymous
in reply to: jeremytammik

Great, thanks for sharing that!

Message 15 of 21
lloyolaRLE
in reply to: jeremytammik

Thank you very much for that info!!

We'll check it in the future, once we come back to it.

I'll let you all know about the results.

 

Best regards,

Lorenzo Loyola

Message 16 of 21
Anonymous
in reply to: jeremytammik

Thanks @jeremytammik for this information. It s very helpful.

 

Regads!

Message 17 of 21
845179011
in reply to: jeremytammik

I encounter a similar problem.

 WITNS_LINE_GAP_TO_ELT is a type parameter, change this will apply to all dimensions. The end point can be dragged in  UI. So how to set the end point position separately like UI dragging?

Message 18 of 21
jeremytammik
in reply to: 845179011

Just like many other Revit elements, the dimension has a type and individual instances of that type.

 

You say that WITNS_LINE_GAP_TO_ELT is a type parameter.

 

You wish to modify a single instance only.

 

Please take a close look at that instance and all its properties via the API, e.g., using RevitLookup.

 

Modify the end point by dragging in the UI.

 

Observe the differences, as described in how to research to find a Revit API solution:

 

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

 

Please let us know what you find out.

 



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

Message 19 of 21
845179011
in reply to: jeremytammik

Thanks for for response.

I have two linear dimensions with the same type. I look up the instance parameters, all is the same except the parameters represent the dimension length. When I dragged the endpoint of one dimension to change the witness length, no instance parameter changes. When I change the type parameter "witness line gap to element" to a larger value, the diemension that I dragged doesn't change, whereas the "witness line" of the other dimension become longer. I look up the Type of the two dimensions, the parameter "witness line gap to element" become to a the value I changed to.

I was going to upload pictures, but I can't make it because of the bad Internet. I'm sorry for that. The type of the two dimension is general and default.

Message 20 of 21
michael-coffey
in reply to: Anonymous

I've added a Revit Idea for this topic, since I couldn't find an existing one.  Please vote for it if you are following this thread.  Thanks!

https://forums.autodesk.com/t5/revit-ideas/api-control-dimension-s-witness-line-length/idi-p/1073079...

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Customer Advisory Groups


Rail Community