I keep getting this error…what am I doing wrong?
Error
Error: #<NameError: undefined local variable or method `sketchup_extension’ for CaydenWilson::ProTrim:Module>
:22:in `' :10:in `' :9:in `' SketchUp:1:in `eval'Code
#Loading in handles
model=Sketchup.active_model
selection=Sketchup.active_model.selection
entities=Sketchup.active_model.entities
materials=Sketchup.active_model.materials
layer_array=Sketchup.active_model.layers
require "sketchup.rb"
module CaydenWilson
module ProTrim
#Input to gather data for trim
prompts=["Trim Height: ", "Trim Thickness:", "Quarter Round:", "R:", "G:", "B:"]
defaults=[5.0,0.5,"No",255.0,255.0,255.0]
list=["","","Yes|No","","",""]
input=UI.inputbox prompts, defaults, list, "ProTrim"
height,thickness,quarter_round,red,green,blue=input
if quarter_round=='Yes'
quarter_round_width=0.75
quarter_round_height=0.75
end
notification=UI::Notification.new(sketchup_extension, "Select the trim path.")
notification.show
def get_points(axis, height, thickness)
case axis
when X_AXIS
[ [0,0,0], [0,0,height], [thickness,0,0], [thickness,0,height] ]
when Y_AXIS
[ [0,0,0], [0,0,height], [0,thickness,0], [0,thickness,height] ]
end
end
def create_trim_material(materials)
trim_material=Sketchup.active_model.materials.add "Trim"
trim_material.color=[red, green, blue]
trim_group.material=trim_material
end
def build_trim(axis, selection, height, thickness)
pts=get_points(axis, height, thickness)
#Creating a face using array
face=entities.add_face(pts)
edges = face.edges
connected=face.all_connected
face.back_material = "Trim"
material = trim.back_material
face.material = trim
#Selecting edges (path) to extrude on
face.followme( selection.grep(Sketchup::Edge) )
end
def create_trim_layer(layer_array, entities)
new_layer=model.layers.add ("Trim")
model.active_layer=new_layer
name=trim
visable=True
end
end
end