Oh, my! It works! Thank you guys so so much!
TIG you are a Ruby wizard! Thank you for your patience
So, here is my final result:
Oh, my! It works! Thank you guys so so much!
TIG you are a Ruby wizard! Thank you for your patience
So, here is my final result:
Thanks for advice, TIG, but I already tried it... It's too hard code for my low programming skill.
Could you answer me:
Where can I find sketchup dimension tool code for try to edit it? (Is it possible?)
Or how could I solve my problem another way (maybe by replacing text in existing dimensions)?
My current "frankenstein"-code :
require 'sketchup.rb'
SKETCHUP_CONSOLE.show
UI.menu("Plugins").add_item("DimPlugin") {addim}
def addim
entities = Sketchup.active_model.entities
dim = entities.add_dimension_linear [50, 10, 0], [100, 10, 0], [0, 20, 0]
dims = Sketchup.active_model.entities.grep(Sketchup;;Dimension)
i = 0
dims.each do |d|
i+=1
d.text = "D#{i}"
end
end
Thanks again
Thank you! It works much better!
But I still need a way to pick two dimension's points.
Or another decision (if it easier):
I could make dimensions by default Sketchup tool, but then I would to replace all of them by my plugin.
Thank you guys for replying
So, after titanic labour I have produced this:
require 'sketchup.rb'
SKETCHUP_CONSOLE.show
UI.menu("Plugins").add_item("DimPlugin") {addim}
def addim
entities = Sketchup.active_model.entities
dim = entities.add_dimension_linear [50, 10, 0], [100, 10, 0], [0, 20, 0]
dim.text = "D1"
end
And questions:
Thanks again...
Hi all.
I'm not a Ruby programmer and having a headache with one simple question:
Is it possible to create a plugin for making numbers of dimensions instead measurements?
For examle: D1, D2, D3... etc
Asking for help.
Thanks in advance