Dimensions in document and conduit C++

rhino5
dimensions

#1

Hi everybody,

it is not clear to me how to draw a custom dimension (linear, angular, etc.) in Rhino5, in the document and in the conduit. I know some examples have been posted but all the links seem to be expired.
Thanks,

Gennaro


(Dale Fugier) #2

Hi @gennaro,

The Rhino SDK samples can be found here:

The Rhino 5 samples are in the "5" branch.

Does this help?

– Dale


#3

Dale,
still I cannot find a way to get what I need. The only example I found creates the linear dimension through the prompt with CArgsRhinoDimLinear. Should I look more thoroughly?
Thanks for your reply.


(Dale Fugier) #4

Hi @gennaro,

The display pipeline does not have a “draw dimension” method. So, just new up a dimension object and then call it’s draw member.

m_pDim = new CRhinoLinearDimension();

...

m_pDim->Draw(dp);

...

– Dale


#5

Dale,

my problem is exactly what should replace the dots… I have tried to build the instance but my command keeps crashing…


(Dale Fugier) #6

Hi @gennaro,

Sorry, but it isn’t clear to me what dots are. Can you explain further? Perhaps I need more details as to what you are trying to do and why?

– Dale


#7

Dale,
I would like to

  • create custom linear/ angular/etc dimensions from given points/curve/etc. (not from the prompt)
  • draw them in the database
  • draw them in the conduit

(Dale Fugier) #8

Hi @gennaro,

There are several examples of creating dimensions from scratch:

cmdSampleDimAngular2.cpp
cmdSampleDimAngular3.cpp
cmdSampleDimLinear2.cpp
cmdSampleDimRadius.cpp

Let me know if you don’t find what you want.

The above referenced samples add the resulting dimension objects to the document.

The the results of the above samples, which will be some pointer to a CRhinoAnnotationObject-derived object, and call it’s Draw member from within a conduit.

– Dale


#9

Ok Dale, sorry for your time. Your suggestion worked fine… my mistake…