Error message - classextension.rb

Moderator: CPhillips

Error message - classextension.rb

Postby harnstein » Sat Dec 11, 2010 5:11 pm

Hi there,

OT: first i'd like to say "thank you" to hpnisse for your effort on helping me with my last SP problem and sorry that i didn't answer the last post- no good manners ;)

i still could not get it to work and had to continue on some other project...

ON TOPIC:

every time i press the "play" button i get the following error-message: see attachment

anybody knows the solution?

regards, h_
0
still sketchin'

harnstein 
 

Re: Error message - classextension.rb

Postby CPhillips » Thu Dec 23, 2010 5:17 am

At first glance it looks like it might be a conflict with another plugin. Could you let me know which other ones you have installed.
0

CPhillips 
PluginStore Author
PluginStore Author
 

Re: Error message - classextension.rb

Postby harnstein » Fri Jan 07, 2011 5:37 pm

first, happy new year! :)

i've been off till yesterday, visiting my hometown, celebrating, holidays..

thanks for your reply- here they are

#extrusionToolbar.rb
._crease.gif
._extrude.gif
._knife.gif
._proxy.gif
._smooth.gif
._subdivide.gif
._subsmooth.rbs
._subsmooth_load.rb
2DTools\
3DxSketchUp\
BZ_Dir\
CD_ICONS\
clf_shape_bender\
clf_simple_loft\
CURVILOFT_Dir_10\
DEFPARAM_Dir\
Examples\
FixReversedFaceMaterials\
FREDOSCALE_Dir_20\
Icons\
JPP_Dir\
LIBFREDO6_Dir_32\
LIBFREDO6_Dir_33\
LIBFREDO6_Dir_35\
mover2\
mover_extensions\
OBJImport\
Ocean\
Projection\
protrude\
ROUNDCORNER_Dir_20\
ROUNDCORNER_Dir_21\
SketchyPhysics3\
skin\
SoapSkinBubble\
Subsmooth\
TIGtools\
tooling\
TOS_Dir_16\
TT_Lib\
TT_Lib2\
Utilities\
2D#.rb
3DxSketchUp.rb
ArchetypesStairMaker.rb
arraysum.rb
bezierspline.rb
BZ__BSplineU.rb
BZ__CubicBezier.rb
cd_architect.rb
cd_architect_extension.rb
cd_draw_extension_m.rb
cd_draw_m.rb
cd_power_extension_m.rb
cd_power_m.rb
cd_power_n.rb
cd_standard.rb
cd_zelect.rb
cd_zelect_extension.rb
centerpoint.rb
Chamfer_Along_Path.rb
ClassExtensions.rb
cleanup_model.rb
clf_shape_bender_loader.rb
clf_simple_loft_loader.rb
config-thumb.jpg
crease.gif
cubicpanoout.rb
deBabelizer.rb
delauney2.rb
EntsGetAtt.rb
eq_grapher.rb
examples.rb
extensions.rb
extrude.gif
ExtrudeAlongPath.rb
extrudeEdgesByEdges.rb
extrudeEdgesByFace.rb
extrudeEdgesByFaces.rb
extrudeEdgesByLathe.rb
extrudeEdgesByLoft.rb
extrudeEdgesByRails.rb
extrudeEdgesByRailsByFace.rb
extrudeEdgesByRailsToLattice.rb
extrudeEdgesByVector.rb
FAK.rb
FixReversedFaceMaterials.rb
follow_this1.rb
FredoScale_ZH.lang
GetCentroid.rb
getMaterials.rb
heightfield_gen_v6.rb
jf_unfoldtool.rb
jointpushpull.rb
knife.gif
Latticeizer.rb
LibFredo6.rb
LibTraductor.def
LibTraductor.rb
lines2tubes.rb
lsystem.rb
makefaces11.rb
mesh_additions.rb
Mirror_31.rb
mover.rb
OBJImport.rbs
ocean_extension.rb
offset.rb
parametric.rb
pathcopy.rb
PipeAlongPath.rb
progressbar.rb
projection_extension.rb
proxy.gif
RubyWinFunc.so
SectionCutFace.rb
Sketchup.rb
SketchyFFD.rb
skin.rb
smooth.gif
SoapSkinBubbleTools.rb
stair.rb
subdivide.gif
subsmooth.rbs
subsmooth_load.rb
Thumbs.db
tooling.rb
tt_0000_menu.rb
tt_bitmap2mesh.rb
tt_cleanup.rb
tt_material_tools.rb
tt_plan_tools.rb
tt_uv_toolkit.rb
utilities.rb
vector.flat_angle.rb
vfs.rb
weld.rb
windowizer.rb
ZLoader__Curviloft.rb
ZLoader__FredoScale.rb
ZLoader__OnSurface.rb
ZLoader__RoundCorner.rbv

maybe (or surely) they are a bit messy, i always wanted to clean up a bit.. soon..

maybe you'll find something in there!

greets

_h
0
still sketchin'

harnstein 
 

Re: Error message - classextension.rb

Postby CPhillips » Tue Jan 11, 2011 3:44 am

Ouch. Thats a lot to test. Can you send me a model that fails and I'll take a look.
0

CPhillips 
PluginStore Author
PluginStore Author
 

Re: Error message - classextension.rb

Postby TIG » Tue Jan 11, 2011 11:17 am

You can edit ../Plugins/SketchyPhysics3/ClassExtensions.rb with a plain-text editor [Notepad[++].exe or similar]... around line #59
Code: Select all
class Sketchup::Group
    def definition # make it so you can use group.definition
   return(entities[0].parent)
    end   
end
change it to read
Code: Select all
class Sketchup::Group
  if not Sketchup::Group.method_defined?(:definition)
    def definition() # make it so you can use group.definition
   return(self.entities.parent)
    end
  end#if   
end
This code is used to set the group.definition method not available directly in the API...
In its current form it is looking for a parent of the first entity [0] in the group's entities - if there is no first [0] entity in the entities it fails because 'nil' has no parent.
The suggested change explicitly refers to the group's entities AND even if the entities is empty it returns the parent and thereby the definition...
NOTE: an even safer 'method' is this
Code: Select all
class Sketchup::Group
     # Some times the 'group.entities.parent' refer to the wrong definition.
     # This method checks for this error and locates the correct parent definition.
     if not Sketchup::Group.method_defined?(:definition)
       def definition()
          if self.entities.parent.instances.include?(self)
             return self.entities.parent
          else
             Sketchup.active_model.definitions.each { |definition|
                next if not definition.group?
                return definition if definition.instances.include?(self)
             }
          end
          return nil # Should never happen.
       end
     end#if
    end
Note how the suggested code changes test to see if the group.definition method is already set [by another tool or perhaps even SketchUp in a yet to come API upgrade] and it doesn't change it if it is...
IF you have other scripts that are also defining group.definition [do a 'grep' search through Plugins for "class Sketchup::Group"] it might also be best for you to substitute the same class/method definition and tests for all of them :?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: Error message - classextension.rb

Postby harnstein » Wed Jan 12, 2011 1:10 pm

um, computer's secrets..

i uninstalled / reinstalled SP several times- now, as i get all these helpful advices, i reinstalled SP once more, and it's working again after all..! tsss. havent't changed anything.

so i, you, we cannot figure out what has been the problem.

thanks for your effort, maybe i get that error again one day ;), then i will start here again.


now i can at last check out a skp-SP-file which i had some problems with and got helped here-

:bounce:

an this file i posted in july, as i remember.. ;)

wish you a nice day!
0
still sketchin'

harnstein 
 

Re: Error message - classextension.rb

Postby CPhillips » Thu Jan 13, 2011 10:35 am

I am glad its working. :) but I would have liked to figure out the conflict. :(

I wonder if it might have to do with the order plugins are installed....
0

CPhillips 
PluginStore Author
PluginStore Author
 

Re: Error message - classextension.rb

Postby i74s°° » Sun Mar 06, 2011 9:46 pm

exactly same error i geting after pressing "START"... So after whole day of installing and uninstalling i find that trouble was "clf_simple_loft_01b" plugin. (Error on SU6 and 8 and all SP versions, for me ....(WIN XP,32)) Hope it helps for someone. ;)
0

i74s°° 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to SketchyPhysics

Who is online

Users browsing this forum: No registered users and 0 guests

Visit our sponsors: