[Plugin] Dimension and Leader Text - Toggle Visibility
-
These two toggle one another is wierd ways.
I see they both have "$ dim_visible ..." entries so I'm guessing they are trespassing on another.
How to fix?
What does the "$" symbol do/indicate?
-
-
@jclements said:
These two toggle one another is wierd ways.
I see they both have "$ dim_visible ..." entries so I'm guessing they are trespassing on another.
How to fix?
What does the "$" symbol do/indicate?Change
$dim_visible
to$text_visible
in the text version
In fact find any text that says 'dim' in the text-version of the script and change it to read 'text' to be on the safe side.
BUT I now see you have different 'text' togglers - then the global variables should differ between them - so use say$textLeader_visible
and$textScreen_visible
to separate them...
The$
makes a 'global variable' that can be read by scripts at any time during that session - that's why you have sometimes to switch the toggle twice on start up as it isn't set the very first time. -
TIG:
I got them all to work now. Thanks for the handholding.
I did notice that models with several groups and/or levels of embedded groups it can take quite a while to execute a toggle. ?Is there a way to trigger feedback via a progress bar or a "please wait" in the Task Bar?
-
To speed it up you could recast it so that it was a tool to find all Text or Dims etc and then put it onto a TEXT-LEDR, TEXT-SCRN or DIMS-LINR, DIMS-RADL etc
Then make a tool that toggles those layers on/off - they'll vanish/appear much quicker ? -
I am not sure if I understand what you are asking and why it would be faster. Do you mean a script similar to how your move|delete Construction Objects is structured?
If so, then I think NOT having it in a context (right-click) menu would be better and be given choices like: context (nothing selected), context_&_recursive, or selection_recursive for each type of text object; then change toggle their visibility. Most of the timeI would not want to move text items to a specific layers because I primarily use layers to isolate equipment and structures by process or project phases and text with leaders and dimensions would need to stay on the layer of the objects they pertain too.
The original scripts above do their job, they are just sluggish in large models and sometimes it seems as if they are not working when they in fact are.
-
OK
So to at least show progress add a 'ticker' to each def of code like this...
I've added lines ending with ###ADDdef TextScreenVisOFF(ents) ticker="." ###ADD ents.each{|e| Sketchup;;set_status_text("Processing"+ticker) ###ADD e.hidden=true if e.typename=="Text" TextScreenVisOFF(e.entities)if e.typename=="Group" TextScreenVisOFF(e.definition.entities)if e.typename=="ComponentInstance" ticker=ticker+"." ###ADD } end#def
These additions will add some text to the VCB line:
Processing.
Processing..
Processing...
Processing....
Processing..... etc
as it does groups/definitions it stars again at 'Processing.'...
At least the VCB will be doing something to show it's processing... -
TIG:
Worked great, thanks.
That was Lesson - Processing Ticker 101. Can we go to Lesson - Processing Ticker 102?
Can a ticker display and increment a digit, once every second (or whatever time increment)?
Would this be the proper way of do this: Ruby would somehow have to access the PC's "clock" (or does that function exist as a command already ?), create a variable with a value of 0 and then increase its value by a value of 1 every second, then refresh display (so the prompts don't run off the screen) and re-display it with the new value.
-
To make a counter try this - it just counts the number of operations...
I've added lines ending with ###ADDdef TextScreenVisOFF(ents) ticker="1" ###ADD ents.each{|e| Sketchup;;set_status_text("Processing "+ticker) ###ADD e.hidden=true if e.typename=="Text" TextScreenVisOFF(e.entities)if e.typename=="Group" TextScreenVisOFF(e.definition.entities)if e.typename=="ComponentInstance" ticker=ticker.next ###ADD } end#def
These additions will add some text to the VCB line:
Processing.
Processing 1
Processing 2
Processing 3
Processing 4 etc
as it does groups/definitions it stars again at 'Processing 1'...
At least the VCB will be doing something to show it's processing... -
Works ok. Thanks again.
Advertisement