src/jwm_draw_framing/draw_framing.rb
## ====================================================
## Create geometry for the cross-section in the model
Create geometry for the cross-section in the model
Create geometry for the cross - section in the model
def create_geometry(p1, p2, view)
  puts "create_geometry called"
			 ## if comp_name
		 ## if @state < 2    
         ## reverse direction to pushpull
       ## if @state == 3
  end
def create_geometry ( p1 , p2 , view ) puts "create_geometry called" end
Create geometry for the cross-section in the model
Create geometry for the cross - section in the model
##    puts "create_geometry called" # if @state < 2 ##then we haven't yet created any geometry, so create the cross-section face # @model = Sketchup.active_model # @model.start_operation("DrawFraming") # @state = 2 ## Waiting for pick or VCB entry to define length of component # @@df_tool_id = @model.tools.active_tool_id ## Remember DrawFraming tool_id # Create an empty component definition # @ents = @model.definitions # @comp_defn = @ents.add("comp") # Create an empty group to draw into # @grp = @model.active_entities.add_group() # @ents = @grp.entities # Define cross-section and name it # comp_defn_name = UI.inputbox ["Component name "],["Frame element"],"Name this component "  # if comp_defn_name ## inputbox was not cancelled) # @comp_defn.name = @n_size[@chosen_size][0] + " " + comp_defn_name[0].to_s # @comp_defn.description = @n_size[@chosen_size][0] + " "  +comp_defn_name[0].to_s # Insert face into new component definition # ents = @comp_defn.entities # puts "@comp_defn class = " + @comp_defn.class.to_s    # @face = ents.add_face(@profile_points3) # Insert an instance of the component at the origin # @model.active_entities.add_instance(@comp_defn, @tf_identity) # puts "@face.vertices = " + @face.vertices.inspect.to_s # @last_drawn = [@comp_defn] # Orient face normal to @reported_normal and correctly oriented: four steps # 1. Rotate the cross-section around Z_AXIS at world or component origin  #   to align with @face.normal # @comp_defn.instances[-1].transform!(@tf3) # 2. Revolve around normal to the Z_AZIS and the @face.normal # @comp_defn.instances[-1].transform!(@tf4) # 3. Rotate by 90 degrees about @reported_normal @quad times # i=1 # while i <= @quad do # @comp_defn.instances[-1].transform!(@rotate90_la) # i += 1 # end # 4. Move inserted component face from origin to pick point # @comp_defn.instances[-1].transform!(@tf2)			  # Select only the newly created face inside the component # @model.selection.clear # @model.selection.add @face  # If operation cancelled  # else # @model.abort_operation ## alternative way to cancel # self.reset(view) # end ## if comp_name # end ## if @state < 2     # ------------------------ # if @state == 3 && @face ## a component face has been drawn # Pushpull cross-section to length # puts "create_geometry called state 3" # if @face.normal == @reported_normal # @face.pushpull @frame_length  # else ## reverse direction to pushpull # @face.pushpull -@frame_length # end # puts "@comp_defn.instances[-1] = " + @comp_defn.instances[0].to_s # @comp_defn.name = @profile[0] + " " + @n_size[@chosen_size][0] + " x " + @frame_length.to_l.to_s # @model.selection.clear # self.reset(view) # @model.commit_operation # end ## if @state == 3
p1
<not_specific>
p2
<not_specific>
view
<not_specific>