0 Members and 1 Guest are viewing this topic.
;;----------------------------------------------------------- (defun _selectPoints () (and (setq sp (kdub:getpoint "Select Start Point (ENTER to QUIT)" "Quit" 1 '("Quit") nil ) ) (/= "Quit" sp) (setq op (kdub:sgp "Select ORIENTATION Direction (in current UCS)" nil sp) ) (setq orient_ang (angle sp op) sp (polar sp orient_ang weldgap) ) ) ) ;;----------------------------------------------------------- ;; (while (_selectPoints) ;;Proceed (kdub:ucs:blackbox nil (trans sp acucs acworld) (kdub:vec:points->vector (trans sp acucs acworld) (trans (polar sp (+ orient_ang kglobal:rad90) -100) acucs acworld) ) (kdub:vec:points->vector (trans sp acucs acworld) (trans op acucs acworld) ) t ) ;;--------------------------------------- ;; Draw the outline (kdub:mark) (setq outline (vlax-ename->vla-object (kbub:EntmakePlineInUCS vertexlist var:layer-outline50 0) ) ) ;; Add Xdata to profile (_xdata_elbow45 (entlast)) ;;-------------------------------------- ;; add ellipse halves (if (= index 0) ;; left view (progn (vla-put-layer (setq obj (vlax-invoke kglobal:modelspace 'addEllipse (trans (list 0. var7 0.) acucs acworld) (trans (list od2 0. 0.) acucs acworld T) (sin kglobal:rad45) ) ) var:layer-hiddenmedium ) (vla-offset obj (- wt)) (vlax-put obj 'StartParameter PI) (vlax-put obj 'EndParameter 0.0) (vla-put-layer (vlax-invoke obj 'mirror (vlax-curve-getStartPoint obj) (vlax-curve-getEndPoint obj) ) var:layer-outline50 ) ) ;; else right view (progn (vla-put-layer (setq obj (vlax-invoke kglobal:modelspace 'addEllipse (trans (list 0. var7 0.) acucs acworld) (trans (list od2 0. 0.) acucs acworld T) (sin kglobal:rad45) ) ) var:layer-outline50 ) (vla-offset obj (- wt)) ) ) ;;--------------------------------------- ;; Draw the CenterLine (if (= pipe:drawcenterline 1) (vla-put-layer (vlax-invoke kglobal:modelspace 'addline (trans (list 0. 0. 0.) acucs acworld) (trans (list 0. var7 0.) acucs acworld) ) var:layer-centershort ) ) ;;--------------------------------------- ;; Draw the WallThickness (if (= pipe:drawwallthickness 1) (progn (vla-put-layer (setq wallLine (vlax-invoke kglobal:modelspace 'addline (trans (list 0. 0. 0.) acucs acworld) (trans (list 0. var7 0.) acucs acworld) ) ) var:layer-hiddenmedium ) (vla-offset wallLine (- od2 wt)) (vla-offset wallLine (- (- od2 wt))) (vla-delete wallLine) ) ) ;;-------------------------------------- (getstring "\n Paused for debug") ;;-------------------------------------- (vl-cmdf "_.REDRAW") (vl-cmdf "_.UCS" "_Restore" prev:ucs) )
I can't post the complete code for this, but those interested may find the ellipse drawing code useful.Some of the methods are from my library, but I think you'll get the core idea.