[Plugin] 2D Tools
-
@mitcorb said:
TIG:
No file browser opened. I will try again.
(I am not fluent with image capturing and posting, so I had to try again. The process is so opaque, that is, you gotta trust that the results will be favorable.)EDIT: see attachment.
I typed the statement into the line input box. I thought there was a required space before the parentheses. That is why I got the warning.
But in each case I got the word "nil".EDIT2: for your info, I verified that the hatching file has all of the jpg content.
No <space> before the ( ). BUT it's failing anyway.
What happens if you copy/paste just the textUI.openpanel
into the Console - still no open_panel ?Seems your Sketchup isn't opening a file_open_dialog like it should ???
-
I am not sure if the file is corrupted or if there is a bug in Ruby. It was made by cutting and pasting geometry from antoher file which had a half dozen imported DWG files.
Any elevation readings taken for geometry below z=0 are wrong (using either the 2d Set Z-Plane tool or Robin Hill's, Height.rb). What should be -26' shows as -25', what should be -9.5' shows as -9.0'
Stranger still, is that Robin's script adds in two dashes for a negative value. It has never done that before.
If I create a new file with new geometry then both Robin's script and 2d Set Z-Plane tool work correctly.Any guess as to what is going on?
-
I think the bug is in Sketchup and the use of 'Engineering' units [always feet].
If you change to 'Decimal' units [feet] it works fine.
Any other units format also works properly too...
It's as if with Engineering Feet it does a 'round' to an integer and does a double negative to boot !
There's nothing wrong with the SKP file itself - indeed it's the same in any new SKP that's set to have Engineering Feet as its units and -ve Z values taken from the point are reported wrongly as a length/length.to_s.
The Tools are blameless too...Bug report for v7.1 ?
-
It would be nice to see a few examples of how people are using 2D Tools in their own work.
Regards,
Bob -
TIG:
UI.openpanel called up the folder My Documents after typing into the console.
When I cancelled the call, the nil showed on the second line of the following insert. Then I typed in the other arguments- carefully- and you can see what returned.
(This is Sketchup 6free, last update, XPHomeSP3)UI.openpanel
nil
folder="C:/Program Files/Google/Google Sketchup 6/Plugins/2Dtools/Hatching/"
C:/Program Files/Google/Google Sketchup 6/Plugins/2Dtools/Hatching/
file1=Dir[folder+"*.jpg"].last
C:/Program Files/Google/Google Sketchup 6/Plugins/2Dtools/Hatching/PATT__SOLID.jpg
UI.openpanel(Choose HATCHING...",folder,file1)
(eval):149: warning: parenthesize argument(s) for future version
Error: #<SyntaxError: (eval):149: compile error
(eval):149: unterminated string meets end of file
(eval):149: syntax error
UI.openpanel(Choose HATCHING...",folder,file1)
^>
(eval):149Thanks,
mitcorbEDIT: I see I left out a " before Choose HATCHING. When I inserted each argument with corrected punctuation, I got "nil" at the end.
-
Hello TIG.
I tried 2dtool and found the following errors.
The lines do not extend to circles and arcs
The arches, extend one end. the other end is not extended.
The line of destiny, color cyan, turns off in areas where it is intersected by another line[flash=425,344:x5dl6kqm]http://www.youtube.com/v/mI37VX17nqk[/flash:x5dl6kqm]
-
Hi TIG:
Thank you for looking at the file. I did further test and similar things happened with 7.0 and 6.0.
I opened previous revision levels (backups) of the file and when I changed the units to Engineering, the error popped up. I thinking it could be a rounding error, but not so sure now.I will send the file to SU folks.
-
TIG:
Here are the results on the double slash input:
(eval):149
folder="C:\Program Files\Google\Google Sketchup 6\Plugins\2Dtools\Hatching\"
C:\Program Files\Google\Google Sketchup 6\Plugins\2Dtools\Hatching
UI.openpanel("Choose HATCHING...",folder,file1)
Error: #<NameError: (eval):149: undefined local variable or method `file1' for main:Object>
(eval):149
---I had to insert a " in front of the word Choose, because I got a syntax error comment, and noticed that you may have copy/pasted my mistake in your new instructions.---Second results: since first did not work:
folder="C:/Program Files/Google/Google Sketchup 6/Plugins/2Dtools/Hatching/"
C:/Program Files/Google/Google Sketchup 6/Plugins/2Dtools/Hatching/
UI.openpanel("Choose HATCHING...",folder,file1)
Error: #<NameError: (eval):149: undefined local variable or method `file1' for main:Object>
(eval):149
---Again corrected for the missing "---Lemme know,
mitcorb -
mitcorb
Another slant... Copy/Paste these 3 lines of red text into the Ruby Console and see what happens...
folder="C:\\Program Files\\Google\\Google Sketchup 6\\Plugins\\2Dtools\\Hatching\\" file1="*.jpg" UI.openpanel("Choose HATCHING...",folder,file1)
If nothing works then change them to these 3 and try again:
folder="C:/Program Files/Google/Google Sketchup 6/Plugins/2Dtools/Hatching/" file1="*.jpg" UI.openpanel("Choose HATCHING...",folder,file1)
I think it's something to do with SUp v Ruby syntax changed in the updates of Versions... We will sort this -
@jclements said:
Hi TIG:
Thank you for looking at the file. I did further test and similar things happened with 7.0 and 6.0.
I opened previous revision levels (backups) of the file and when I changed the units to Engineering, the error popped up. I thinking it could be a rounding error, but not so sure now.I will send the file to SU folks.
It's not the file as it happens with all models with -ve Z in Engineering Units... Seems as far back as v6 ! It's not the tools, as you can reproduce the effect by trying to get set the -ve Z to_s in the Console and you'll get a rounded -- version !!!
-
We have both messed up... I copied the text from yours - hence the missing "...
You failed to setfile1=
- you only pasted line 1 and 3 - you missed line 2 !Please try again with the " and all three lines.
One defines the folder, two the file and three is theUI.openpanel
command... -
OK, TIG:
I am at a different machine right now.
I will retry in about 3-4 hours at the one with the problem.Interesting! I loaded 2dtools at my office on SU6pro. Still cannot get hatching to proceed. Is there something I might be doing wrong? Or is there possibly some other plugin or extension interrupting this one?
Oh well, let's get the issue resolved at the first location.
mitcorb
-
Hi TIG, On my system, I am still having problems with flashing shadows under SU's pull down menus while 2DFreehand is the active selection. SU hangs if I try to close SU while this command is active, but if I change the selection, I am able to exit SU. The problem persist even I removed every other plugin, except SU.rb, and 2D#.rb.
I do not have this problem at home, so its not the ruby that is at fault. Any ideas, anyone, as to where on my system I can look for a solution? I have tried disabling WinXP's menu shadow, and unchecking SU's OpenGL preferences with no effect.
-
Ok, TIG:
I am at the machine on which I first had the problem.The double backslash method pulled up the HATCHING folder this time, with contents. But see the results:
folder="C:\Program Files\Google\Google Sketchup 6\Plugins\2Dtools\Hatching\"
C:\Program Files\Google\Google Sketchup 6\Plugins\2Dtools\Hatching
file1="*.jpg"
*.jpg
UI.openpanel("Choose HATCHING...",folder,file1)
nil
-----I did not change anything in the console display.I will now run the second set with the forward slashes just to be thorough:
folder="C:/Program Files/Google/Google Sketchup 6/Plugins/2Dtools/Hatching/"
C:/Program Files/Google/Google Sketchup 6/Plugins/2Dtools/Hatching/
file1="*.jpg"
*.jpg
UI.openpanel("Choose HATCHING...",folder,file1)
nil
---- and running it in this form did NOT call up the HATCHING folder, or anything else. -
@mitcorb said:
Ok, TIG:
I am at the machine on which I first had the problem.
The double backslash method pulled up the HATCHING folder this time, with contents. But see the results:folder="C:\Program Files\Google\Google Sketchup 6\Plugins\2Dtools\Hatching\"
C:\Program Files\Google\Google Sketchup 6\Plugins\2Dtools\Hatching
file1="*.jpg"
*.jpg
UI.openpanel("Choose HATCHING...",folder,file1)
nil
-----I did not change anything in the console display.
I will now run the second set with the forward slashes just to be thorough:folder="C:/Program Files/Google/Google Sketchup 6/Plugins/2Dtools/Hatching/"
C:/Program Files/Google/Google Sketchup 6/Plugins/2Dtools/Hatching/
file1="*.jpg"
*.jpg
UI.openpanel("Choose HATCHING...",folder,file1)
nil
---- and running it in this form did NOT call up the HATCHING folder, or anything else.We will find what's up...
Do I understand that the \ method worked ? If not then please try these 3 lines [they have the end \ or / removed from the folder path...]
folder="C:\\Program Files\\Google\\Google Sketchup 6\\Plugins\\2Dtools\\Hatching" file1="*.jpg" UI.openpanel("Choose HATCHING...",folder,file1)
and this alternative...
folder="C:/Program Files\/Google/Google Sketchup 6/Plugins/2Dtools/Hatching" file1="*.jpg" UI.openpanel("Choose HATCHING...",folder,file1)
We will prevail !
When you get the folder open what do you get if you select afile and then press OK, then do it another time and press Cancel...
-
Hi, TIG:
Here are the contents of the console using the double backslash input, and selection of ANGLE PATTERN. The Hatching folder comes up with the patterns displayed in list form rather than thumbnail form, in this case.
folder="C:\Program Files\Google\Google Sketchup 6\Plugins\2Dtools\Hatching\"
C:\Program Files\Google\Google Sketchup 6\Plugins\2Dtools\Hatching
file1="*.jpg"
*.jpg
UI.openpanel("Choose HATCHING...",folder,file1)
C:\Program Files\Google\Google SketchUp 6\Plugins\2DTools\Hatching\PATT_ANGLE.jpg----HERE IS THE SAME CALL UP, EXCEPT CANCEL THE SELECTION:
folder="C:\Program Files\Google\Google Sketchup 6\Plugins\2Dtools\Hatching\"
C:\Program Files\Google\Google Sketchup 6\Plugins\2Dtools\Hatching
file1="*.jpg"
*.jpg
UI.openpanel("Choose HATCHING...",folder,file1)
nil
When I cancelled, the window closed, no other activity, and the "nil" was displayed.
Since this was successful, do you still want me to run the second suggestion and the alternative? -
mitcord - I have the answer ! [I thnk ]
Watch for an update very soon... We will give you hatching...
-
Ok, TIG:
Say, what do you do--take power naps? -
Here's v3.5 http://forums.sketchucation.com/viewtopic.php?p=185760#p1857605
Hatching Tool made v6/XP friendly.
Adjust to Arcs changed to individual Segments.
2D Text now has a Snap setting for Z-plane or All-Faces.Feedback please...
-
TIG:
SUCCESS!!!!!!!
Made a 2d rectangle on default 0 zplane, gave it a 2d face, selected hatching tool, folder popped up, selected angle patt and it was applied. Incidentally, I did this procedure with the Ruby Console open, and there was no data on any of the actions.Comments: the angle pattern does not display boldly, you must zoom in. Have not tried any other patterns. I assume they are scalable.
Buncha Questions:
What is so special about the double backslash method?
Why did your original code work for so many other users and not for my case, and maybe others?
Is this something that all plugin authors should be considering, or is it unique to SU6?, or XP?
Does this fix also address the linestyle question?Thank you very much for all that you do!
mitcorb
Advertisement