Is there a way to adjust a witness line gap?

Is there a way to adjust a witness line gap?

Anonymous
Not applicable
4,693 Views
20 Replies
Message 1 of 21

Is there a way to adjust a witness line gap?

Anonymous
Not applicable

 

 

 

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!

0 Likes
4,694 Views
20 Replies
Replies (20)
Message 2 of 21

jeremytammik
Autodesk
Autodesk

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

 



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

0 Likes
Message 3 of 21

Anonymous
Not applicable

@jeremytammik

ok, thanks!

I'll be waitingSmiley Happy

0 Likes
Message 4 of 21

Anonymous
Not applicable

Hi @jeremytammik

I am waiting for your reply!

Is there no way?

0 Likes
Message 5 of 21

jeremytammik
Autodesk
Autodesk

No reply yet...

 



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

0 Likes
Message 6 of 21

Anonymous
Not applicable

@jeremytammik

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

thank you so much!!!

0 Likes
Message 7 of 21

lloyolaRLE
Participant
Participant

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

 

Regards 

0 Likes
Message 8 of 21

jeremytammik
Autodesk
Autodesk

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

0 Likes
Message 9 of 21

Anonymous
Not applicable

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
Not applicable

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

0 Likes
Message 11 of 21

jeremytammik
Autodesk
Autodesk

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

0 Likes
Message 12 of 21

Anonymous
Not applicable

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

0 Likes
Message 13 of 21

jeremytammik
Autodesk
Autodesk

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
Not applicable

Great, thanks for sharing that!

0 Likes
Message 15 of 21

lloyolaRLE
Participant
Participant

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
Not applicable

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

 

Regads!

0 Likes
Message 17 of 21

845179011
Enthusiast
Enthusiast

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?

0 Likes
Message 18 of 21

jeremytammik
Autodesk
Autodesk

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

0 Likes
Message 19 of 21

845179011
Enthusiast
Enthusiast

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.

0 Likes
Message 20 of 21

michael-coffey
Advocate
Advocate

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...

0 Likes