[Plugin] SectionCutFace
-
Thanks a lot,it helped me, now I'll use both plugins . It is the coolest feature in sketchup to be able to make pictures with section cuts.
-
I put the file in plugin folder and shows this error:
Error Loading File SectionCutFace.rb
C:/Program Files/Google/Google SketchUp 7/Plugins/SectionCutFace.rb:1: syntax error
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
^
C:/Program Files/Google/Google SketchUp 7/Plugins/SectionCutFace.rb:2: syntax error
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-gb" xml:lang="en-gb">
^
C:/Program Files/Google/Google SketchUp 7/Plugins/SectionCutFace.rb:2: syntax error
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-gb" xml:lang="en-gb">
^what can i do?
-
@cgomez73 said:
I put the file in plugin folder and shows this error:
Error Loading File SectionCutFace.rb
C:/Program Files/Google/Google SketchUp 7/Plugins/SectionCutFace.rb:1: syntax error
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
^
C:/Program Files/Google/Google SketchUp 7/Plugins/SectionCutFace.rb:2: syntax error
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-gb" xml:lang="en-gb">
^
C:/Program Files/Google/Google SketchUp 7/Plugins/SectionCutFace.rb:2: syntax error
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-gb" xml:lang="en-gb">what can i do?
That is NOT the real file!
Somewhere along the line you have saved the linking html code and not the .rb file itself
None of that quoted text appears in the real script's file.
Have you successfully Ruby scripts before ?
You should be able to click on the link OR right-click context-menu 'Save_as' and then give it a path/name.
I'll PM'd you a zipped version. Download that zip file - hopefully it won't corrupt. Extract the .rb file from the zip and put the .rb file into the Plugins folder, replacing the corrupted version you have at the moment! Restart Sketchup to see if it works. -
Thanks with continuing to develop this plugin -- it comes in very handy when needed.
-
Is there a way to alter the code so that one could limit the choices for solid fill color? I typically only use 3-4 colors in my models, depending on what I'm doing. I can leave it default, and change later, but it would be nice not to have the long list pop when I do want to switch.
I've looked at the code, see where the materials get called, but do not know enough to enter a list of specific options.
-
@bmike said:
Is there a way to alter the code so that one could limit the choices for solid fill color? I typically only use 3-4 colors in my models, depending on what I'm doing. I can leave it default, and change later, but it would be nice not to have the long list pop when I do want to switch.
I've looked at the code, see where the materials get called, but do not know enough to enter a list of specific options.Find lines #424+:
colours = Sketchup::Color.names.join('|') cedges = colours ###v1.3 colours = "<Default>|<No_Face>|"+colours ###v1.3###v2.5
and change it thus:
colours = ["Red|Orange|Yellow|Green|Blue|Violet|Black|White|Gray|Brown|Pink"] cedges = colours ###v1.3 colours = "<Default>|<No_Face>|"+colours ###v1.3###v2.5
In the first line add whatever colors you want inside the [], inside "", always ensure there is a '|' separator between each of them as shown above - the full list of available colors is here http://code.google.com/apis/sketchup/docs/ourdoc/color.html#introduction - note the spelling must be as shown, e.g. 'gray' NOT 'grey' etc...
If you don't want the edges (cedges) to have the same color choices at the faces, then change the second line to be its own [] list.
If you don't want '<Default>' and/or '<No_Face>' options you can either put # in front of the third line to stop it loading completely, OR just remove the unwanted option - always ensure that there is a '|' separator between each of them and the rest of the colors.Now later on... lines #430+
@@colour = Sketchup::Color.names[7] if not @@colour ### Black @@edge = Sketchup::Color.names[7] if not @@edge ### Black
To set the default color[s] in the dialog either work out which value to put instead of [7], remembering that the 1st item is [0] etc, and the 8th item is [7] - e.g.@@colour = colours[8] if not @@colour
in the above example if the two '<>' options are also added to the colors list.
OR simply set it by its 'name' thus:
@@colour = "Black" if not @@colour
[that's always assuming that you have 'Black' in your color list!] -
Thanks TIG!
I'll look at this weekend. Big project to detail and move into LayOut next week for construction documents, so this will be helpful.Yes, black is always in my model, usually my line color!
-
Hi, just tried your plugin with zorro 2 with podium 2.5 running on sketchup 8, win64. It is a thing of beauty.
-
Thanks TIG.
-
Very useful plugin. Thanks
-
Thank you for sharing this ruby
-
Incredibly usefull plugin.
I've found a very annoying bug on the new version on Sketchup 8 Pro though. It used to work great with the previous versions.
It fails to create a new layer and move the group backwards a bit so it appears on the section view. I've tried several combinations of the plugin's preferences and all resulted in the same bug.
Here's what i got on my ruby console window:
Error; #<TypeError; reference to deleted Edge> C;/PROGRA~2/Google/GOOGLE~3/Plugins/SectionCutFace.rb;361;in `faces' C;/PROGRA~2/Google/GOOGLE~3/Plugins/SectionCutFace.rb;361;in `initialize' C;/PROGRA~2/Google/GOOGLE~3/Plugins/SectionCutFace.rb;359;in `each' C;/PROGRA~2/Google/GOOGLE~3/Plugins/SectionCutFace.rb;359;in `initialize' C;/PROGRA~2/Google/GOOGLE~3/Plugins/SectionCutFace.rb;358;in `times' C;/PROGRA~2/Google/GOOGLE~3/Plugins/SectionCutFace.rb;358;in `initialize' C;/PROGRA~2/Google/GOOGLE~3/Plugins/SectionCutFace.rb;476;in `new' C;/PROGRA~2/Google/GOOGLE~3/Plugins/SectionCutFace.rb;476 C;/PROGRA~2/Google/GOOGLE~3/Plugins/SectionCutFace.rb;361;in `call' C;/PROGRA~2/Google/GOOGLE~3/Plugins/SectionCutFace.rb;361
-
Can you try this [make a backup copy first outside of Plugins in case you mess up!]
Edit the .rb file with Notepad or Notepad++, around line #360 there are these linesif e.class == Sketchup;;Edge and @@edges == "No" ###v2.2 e.erase! if not e.faces[0] end #if
change them to read
if e.class == Sketchup;;Edge and @@edges == "No" ###v2.2 e.erase! if e.valid? and not e.faces[0] end #if
i.e. add in '
e.valid? and
'
The code should be OK as it was but this will make it more foolproof
Save it and retry - see if the error repeats - if not let me know and I'll issue an update, if it's still an issue can you post or PM me the SKP with the problem with a brief explanation and I'll try and see what's up... -
Here's v2.6 http://forums.sketchucation.com/viewtopic.php?p=172583#p172583
It now traps for potential rare bugs if it tries to erase an object that's already erased...
[as recently raised by 'pilger']... -
Thanks TIG. I rarely use sections but when I do, I always use this plugin, too. I haven't encountered the bug you mentioned yet but it's always good to have the latest build of a plugin.
-
On some very complex forms with many overlapping holes etc there's a lot of 'tidying up' to do... and I suspect that rarely it was trying to erase an edge that it'd just erased milliseconds before, as the edges listings 'iterate'... but stripping out invalid edges is not well done in my old code!
Anyway now I've trapped all of the
xxx.erase!
commands making themxxx.erase! if xxx.valid?
- so if it's just erased something and thinks to do it again then it doesn't bother because the.valid?
is alwaysfalse
if an object ceases to exist !I appreciate you probably glazed over after a couple of
ruby-red
texts... but it's a simple fix to a rare glitch... -
TIG, thank you again.
-
Great plugin, TIG, thank you
-
Cheers, TIG.... one of my favorites.....!
-
Ah, sorry for the lack of response back there TIG. I've been sort of away from modeling for a while.
The plugin seems to be working flawlessly now. Perfect. It's one of the plugins i use the most and i had to turn back to an older version i had stored somewhere here when i stumbled upon that problem, so many many thanks for the fix!
Advertisement