G
Greg Frazier
Hello,
I am encountering the following runtime error:
load('C:\\SketchUp\gfVirtualWMS.rb')
Error: #<NoMethodError: C:/Program Files/Google/Google SketchUp
6/Plugins/gfMakePallet01.rb:59:in `gfMakePallet01': undefined method
`material=' for nil:NilClass>
C:/Program Files/Google/Google SketchUp 6/Plugins/gfMakePallet01.rb:59
The code snippet is as follows:
require 'sketchup'
def gfMakePallet01 (x,y,z,w,l,h,theColor,itemNo,lotNo,qoh,expDate)
model = Sketchup.active_model
value = model.set_attribute "link_data", "url", 115
attrdicts = model.attribute_dictionaries
attrdict = attrdicts["link_data"]
dict_name="link_data"
dicts=model.attribute_dictionaries
if( dicts!= nil and dicts[dict_name] )
dict_key_url = model.get_attribute(dict_name, "url")
else
UI.messagebox("No URL set for this ")
end
materials = model.materials
m = materials.add "Joe"
m2 = materials.add "Fred"
#m.texture="c:\\Program Files\\Google\\Google SketchUp
6\\Materials\\Tile\\Tile_Navy.skm"
#m2.texture="c:\\Program Files\\Google\\Google SketchUp
6\\Materials\\Metal\\Metal_Panel.skm"
color = m.color = theColor
#texture = m.texture
#color = texture.average_color
#if (color)
# UI.messagebox color
#else
# UI.messagebox "Failure"
#end
entities = model.entities
edges = []
model.start_operation "Make Pallet"
# left side plane
pt1 = Geom:oint3d.new(x,y+l,z)
pt2 = Geom:oint3d.new(x,y,z)
pt3 = Geom:oint3d.new(x,y,z+h)
pt4 = Geom:oint3d.new(x,y+l,z+h)
edges[0] = entities.add_line(pt1, pt2)
edges[1] = entities.add_line(pt2, pt3)
edges[2] = entities.add_line(pt3, pt4)
edges[3] = entities.add_line(pt4, pt1)
face = entities.add_face edges
face.material = m
Thank you for your assistance.
Greg
I am encountering the following runtime error:
load('C:\\SketchUp\gfVirtualWMS.rb')
Error: #<NoMethodError: C:/Program Files/Google/Google SketchUp
6/Plugins/gfMakePallet01.rb:59:in `gfMakePallet01': undefined method
`material=' for nil:NilClass>
C:/Program Files/Google/Google SketchUp 6/Plugins/gfMakePallet01.rb:59
The code snippet is as follows:
require 'sketchup'
def gfMakePallet01 (x,y,z,w,l,h,theColor,itemNo,lotNo,qoh,expDate)
model = Sketchup.active_model
value = model.set_attribute "link_data", "url", 115
attrdicts = model.attribute_dictionaries
attrdict = attrdicts["link_data"]
dict_name="link_data"
dicts=model.attribute_dictionaries
if( dicts!= nil and dicts[dict_name] )
dict_key_url = model.get_attribute(dict_name, "url")
else
UI.messagebox("No URL set for this ")
end
materials = model.materials
m = materials.add "Joe"
m2 = materials.add "Fred"
#m.texture="c:\\Program Files\\Google\\Google SketchUp
6\\Materials\\Tile\\Tile_Navy.skm"
#m2.texture="c:\\Program Files\\Google\\Google SketchUp
6\\Materials\\Metal\\Metal_Panel.skm"
color = m.color = theColor
#texture = m.texture
#color = texture.average_color
#if (color)
# UI.messagebox color
#else
# UI.messagebox "Failure"
#end
entities = model.entities
edges = []
model.start_operation "Make Pallet"
# left side plane
pt1 = Geom:oint3d.new(x,y+l,z)
pt2 = Geom:oint3d.new(x,y,z)
pt3 = Geom:oint3d.new(x,y,z+h)
pt4 = Geom:oint3d.new(x,y+l,z+h)
edges[0] = entities.add_line(pt1, pt2)
edges[1] = entities.add_line(pt2, pt3)
edges[2] = entities.add_line(pt3, pt4)
edges[3] = entities.add_line(pt4, pt1)
face = entities.add_face edges
face.material = m
Thank you for your assistance.
Greg