[REQ] Automatic Labels or Dimensions ?
-
Does this yet existing for a selection of straight lines in one click ?
-
If you mean like this, then, in a word, Oui.
Edit, but if you mean multiple in one click, the answer is longer.
-
@ Box
Wanted
I select some nude straight lines : Then call a plugin (if existing)
result : all each line selected have now a Dimension or a "lablel of a dimension" !
(following how the plugin is made) -
I realised after I posted that you wanted auto on multiple Lines.
I can't think of anything that will do that just now. -
@unknownuser said:
Does this yet existing for a selection of straight lines in one click ?
True dimensions have a "dynamic" quality that a plugin's add_text can not duplicate. However, if the length label you would get from selecting the midpoint of a line is sufficient, then that can easily be done.
mod = Sketchup.active_model ent = mod.active_entities sel = mod.selection begin edge=sel.first spt=edge.start.position ept=edge.end.position mpt=Geom;;Point3d.linear_combination(0.5,spt,0.5,ept) dim=edge.length.to_s grp=ent.add_group;ge=grp.entities txt=ge.add_text(dim,mpt,[0.5,0.0,0.5]) txt.leader_type=1 txt.arrow_type=3 sel.remove edge end until sel.empty?
-
Cool for the effort...
But seems there is a glitch
and very difficult to input on the ruby console without carriage return to line!Error; #<SyntaxError; (eval); compile error (eval); syntax error, unexpected tIDENTIFIER, expecting $end ... ent = mod.active_entities sel = mod.selection begin edge=se... ^> (eval)
Maybe errors come from the difficulties to input inside the ruby console!
-
Sorry about that. I always use Ruby Web Console to create and run short plugins such as this one. Here it is as a "one" liner.
mod=Sketchup.active_model;ent=mod.active_entities;sel=mod.selection;mod.start_operation "auto label";begin;edge=sel.first;if edge.is_a?(Sketchup;;Edge);spt=edge.start.position;ept=edge.end.position;mpt=Geom;;Point3d.linear_combination(0.5,spt,0.5,ept);dim=edge.length.to_s;grp=ent.add_group;ge=grp.entities; txt=ge.add_text(dim,mpt,[1,0,1]);txt.leader_type=1;txt.arrow_type=3;end;sel.remove edge;end until sel.empty?;mod.commit_operation
Just for fun, here is an attempt at creating a "dimension". The problem is that it is so view dependent.
mod=Sketchup.active_model;ent=mod.active_entities;sel=mod.selection;mod.start_operation "auto dim";begin;edge=sel.first;spt,vec=edge.line;ept=edge.end.position;dim=edge.length.to_s;vec.length=edge.length/2.0 - dim.length;grp=ent.add_group;ge=grp.entities;ge.add_line spt.offset([0,0,1]),spt.offset([0,0,6]);ge.add_line ept.offset([0,0,1]),ept.offset([0,0,6]);txt=ge.add_text(dim,spt.offset([0,0,5]),vec);txt=ge.add_text("",ept.offset([0,0,5]),vec.reverse);txt.leader_type=1;txt.arrow_type=3;sel.remove edge;end until sel.empty?;mod.commit_operation
-
@unknownuser said:
That is curious that this follow don't exist in native and difficult to make in Script!
[attachment=0:1pedr9ym]<!-- ia0 -->aacurious.jpg<!-- ia0 -->[/attachment:1pedr9ym]
Nothing in ruby
But TIG gave the basic idea to make it: you store a dimension as a component, then you stretch and move it according to the end position of the edge extremities
I used his idea in this plugin
http://sketchucation.com/forums/viewtopic.php?f=323%26amp;t=55714%26amp;p=506825%26amp;hilit=multiple+dimension+tool#p506825it should be possible to adapt it the way you want it to work, by pre selection
-
@Giro
Missed this one!
I will exam it!Edit: ok I use it ! It's a cool plug but you must click on each thing!
If I have 1000 segments separated i must make 2 * 1000 clicks !
Or I miss something as you speek about a "pre selection"Ps And works only on the horizontal plan ! So not so good for my vertical segments!
-
Bravo!
Now That is prefect for the first one!
Second is more funnyExcellent!
That is curious that this follow don't exist in native and difficult to make in Script!
-
i know this plugin doesn't exactly meet the need
i just suggested that it would be possible to adapt it, by retrieving the end points of a selection of edges, and adapting a dimension/component to them, in bulk
i plan to update the plugin for altitudes, not for vertical edges
do you really have 2000 edges to dimension? or is it an hypothesis...
-
it's a little part!
So no an hypothesis! -
@unknownuser said:
it's a little part!
So no an hypothesis!here is a plugin that does what you want
a video
https://dl.dropboxusercontent.com/u/52719814/videos/multiple_edge_dim_tool.webmonly vertical edges
-
Cool one!
Advertisement