Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update
How to place 'Groups' or 'Components' rotated ?
-
Hi,
I want to expand my Canvas plugin to add rotation values when inserting groups or Components.
Problem is that with the code below the object is inserted using Z axis located on (0,0,0) coordinates and I want to rotate the object using cursor z axis coordinates instead.
I know how to position the position of the vector when I want to raytest but not this...Please Help!
def activate @@sel = Sketchup.active_model.selection[0] ; @@ents = Sketchup.active_model.active_entities ; end #def def onLButtonDown(flags,x,y,view) ip1 = view.inputpoint x,y ; @point = ip1.position ; add_object(@point) ; end #def def add_object(point) vector = Geom;;Vector3d.new 0,0,1 #Want the position to be on cursor t = Geom;;Transformation.new @point, vector, 45.degrees if @@sel.is_a? Sketchup;;ComponentInstance @@ents.add_instance(@@sel.definition,t) ; end if @@sel.is_a? Sketchup;;Group defn = @@sel.entities.parent ; @@ents.add_instance(defn, t) ; end end #def
Advertisement