Dimensioning in C++


I used this example for Linear Dimensions:

And now I want to be able to code other types of dimensions ( like Angular, Radial, Diameter…). Based on the example it should be easy. The only problem is that I don`t know what arguments to set…for example in Linear Dimensions you SetPoint(0,… then SetPoint(2,… (what is 1?). What do you set for Angular( besides the plane)? What do you set for Radial/Diameter? Is there some description that says how to handle different dimensions?


Yes, we are lacking some samples that might help you. I’ll see if I can throw together a couple in the next few days.

In the mean time, you might look through the SDK headers, as they are fairly well documented as far as dimensions are concerned.

I’ve added some simple dimension object creation function to our GitHub samples:

Let me know if this helps.


Is there a way to make a “curved” dimension? At least along an arc? I need a dimension that basically looks the same as Angle Dimension applied to an arc but showing the length and not the angle… ?

@lowell any ideas?

No, I don’t know any way to do that.

Ok thanks, I will try to program it myself because it should be fairly simple (I just have to override the text…can i simply change the “m_angle” variable?) and I think you should include it in the future versions of Rhino. AutoCAD has it and it is called “Arc Length”.

Dale, do you have time for one more example, for Angular Dimension? Or at least point to what I have to set?

Thanks a lot!

Here you go:


Thanks for al the example.s…I just want to return shortly to the question about “arc” dimension. As i thought, the easiest way is to draw an angular dimension and override the text. But i didn`t really find an easy way to override the text…how can I do it (for any type of dimension)?


To override dimension text, do something like this:

CRhinoAnnotationObject* dim_object = ...;
dim_object->SetUserText( user_text );
// TODO....


I was wondering how I can generate the Angular Dimension to work with the arc? In the example you gave me I choose a center point and two lines basically…but how should the code be changed in order to take an Arc as an input?


Sure, try this: