How to set color for DIMENSION_TEXT

How to set color for DIMENSION_TEXT

Postby kimdv » Sat Jun 26, 2021 9:49 am

Hello everyone!
I created a Layout document by Ruby from SU, and added SU model to it. Then, I added dimension by using the following command:

Code: Select all
dim = Layout::LinearDimension.new(start_2d, end_2d, start_offset_length)
doc.add_entity(dim, layer, page)
dim.connect(start_point, end_point)



However, the background color and the border stroke of the DIMENSION_TEXT are always "red", as you can see in the attached file. It happened after I connect the ConnectionPoints (by using "dim.connect(start_point, end_point)" above.

How can I set the color of the stoke and background to be "white" or none?
Thank you very much for your help.
0

kimdv 
 

Re: How to set color for DIMENSION_TEXT

Postby Dan Rathbun » Wed Jul 14, 2021 7:38 pm

kimdv wrote:Hello everyone!
How can I set the color of the stoke and background to be "white" or none?


A Layout::LinearDimension object is a subclass of Layout::Entity, so it inherits the #style= setter method.

Either create a new Layout::Style (or grab it's existing style via the #style getter,) and modify it. Then set it back upon the dimension object using the #style= setter.
0
    I'm not here much anymore. But a PM will fire email notifications.
    User avatar
    Dan Rathbun 
    PluginStore Author
    PluginStore Author
     

    SketchUcation One-Liner Adverts

    by Ad Machine » 5 minutes ago



    Ad Machine 
    Robot
     



     

    Return to Developers' Forum

    Who is online

    Users browsing this forum: No registered users and 9 guests