This is far from complete…but I’m having issues with how to get my input data to a variable to use in my array for points which I am building into a face. Also, I’m trying to get my tool to create trim by selecting edges in a model. How do I create a UI:Notification after the form completes that holds code until the user selects the wanted edges and then can click ok to create the geometry? I’m worried that building my face on a set axis (ex x,z) and will not allow this to happen, hence why the multiline comment is there. If you see anything else wrong, please let me know.
selection=Sketchup.active_model.selection
entities=Sketchup.active_model.entities
materials=Sketchup.active_model.materials
#Input boxes in UI menu which gather measurements for trim
print("Fill in the following information for your trim.")
prompts=["Trim Height", "Trim Thickness:", "Quarter Round:", "R:", "G:", "B:"]
defaults=[5.0,0.5,"No",100.0,100.0,100.0]
list=["","","Yes|No","","",""]
input=UI.inputbox prompts, defaults, list, "Stair Info"
height,thickness,quarter_round=input
if quarter_round=='Yes'
quarter_round_width=0.75
quarter_round_height=0.75
notification=UI::Notification.new(sketchup_extension, "Select the trim path.")
notification.show
def build_trim
#creating points for the new face
#pts[number]=[width,depth,height]
pts=[]
pts[0]=[0,0,0]
pts[1]=[0,0,height]
pts[2]=[width,0,0]
pts[3]=[width,0,height]
#Creating the trim material
interior_trim=materials.add"Interior Trim"
interior_trim.color=[R,G,B]
#Creating a face with the array
face=entities.add_face(pts)
connected=face.all_connected
face.material=interior_trim
#Selecting the line
path=selection
face.followme path
=begin
To fix issue of not following because face is on a different orientation than selection???
if on x axis
def build_trim
#creating points for the new face
#pts[number]=[width,depth,height]
pts=[]
pts[0]=[0,0,0]
pts[1]=[0,0,height]
pts[2]=[width,0,0]
pts[3]=[width,0,height]
#Creating a face with the array
face=entities.add_face(pts)
connected=face.all_connected
#Selecting the line
face.followme(selection)
elif on z axis
def build_trim
#creating points for the new face
#pts[number]=[width,depth,height]
pts=[]
pts[0]=[0,0,0]
pts[1]=[0,0,height]
pts[2]=[0,width,0]
pts[3]=[0,width,height]
#Creating a face with the array
face=entities.add_face(pts)
connected=face.all_connected
#Selecting the line
face.followme(selection)
=end
end