To add label on detail viewport programmatically C#


#1

I would like to know how to add label with leader in the various detail views for a global point programmatically?
I am unable to get the equivalent location from the world system to the detail viewport / page viewport…
I have attached a test job file and the expected output.

When a button is clicked, a page view with detail views including the labels in the page view plane is needed.

A sample code to achieve this would be appreciated.

Also two other things:

  1. is there a way to label in a specific format (text within a circle attached to a leader).
    This is typically a text dot which is not filled.

  2. Is there a method to check if the labels overlap?
    TestLabel.3dm (51.3 KB)


(Dale Fugier) #2

Hi @HepChan,

You can from C++, but not from RhinoCommon. I’ve make a to-do item to provide this:

https://mcneel.myjetbrains.com/youtrack/issue/RH-39687

No there is not. But if you are adding leaders problematically I’m sure you can add a circle around the text. Is this sufficient?

No. But try comparing the bounding boxes of labels to see if they overlap.

– Dale


(Brian Gillespie) #3

RH-39687 is fixed in the latest WIP


#4

Thank you Brian for this fix.

Can you provide a sample code to use the fix.

When will the rhino version with the fix be available?


(Dale Fugier) #5

Hi @HepChan,

If you are using the Rhino WIP, then this sample command should work for you:

https://github.com/mcneel/rhino-developer-samples/blob/wip/rhinocommon/cs/SampleCsCommands/SampleCsWorldToPageTransform.cs

Note, this fix will not appear in Rhino 5.

– Dale


#6

Thank you for this sample code.

I understand it is not available in Rhino 5.

when is the version with the fix intended to be released? this will help me to work accordingly.


(Dale Fugier) #7

For this, you will need to pay attention to the Serengeti category.

– Dale