Weird DimensionLinear behavior

Weird DimensionLinear behavior

Postby ittayd » Sun Jun 18, 2017 3:14 pm

Dimensions that are inside components change their texts based on the instance scale. This is true in the GUI as well as the API.

For example, in the images below, the rectangles are instances of the same component. I open the left one, get a dimension entity and its text and then open the right one and get the text of the same entity which changed. A similar thing happens for positioning

Is there a way to get all texts of the dimension instance? Is there a way of programmatically change one?

(I'm using SU 17.2.2555)



Re: Weird DimensionLinear behavior

Postby driven » Sun Jun 18, 2017 5:58 pm

you can do things by comparing instance scaling...

Code: Select all
model = Sketchup.active_model
defs = model.definitions
insts = defs[0].instances
insts.each{|i| p (i.scaled_size - i.unscaled_size)[0].to_mm if i.scaled_size != i.unscaled_size}

learn from the mistakes of others, you may not live long enough to make them all yourself...

PluginStore Author
PluginStore Author

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago

Ad Machine 


Return to Developers' Forum

Who is online

Users browsing this forum: IDMK18, TIG and 2 guests

Visit our sponsors: