beroffers.blogg.se

Load autocad lisp
Load autocad lisp










) MakeWipeout creates a "wipeout" from a points list and the normal vector of the object ( defun MakeWipeout (pt_lst nor / dxf10 max_dist cen dxf_14 ) ( setq dxf10 ( list ( apply 'min ( mapcar 'car pt_lst )) ( apply 'min ( mapcar 'cadr pt_lst )) ( caddar pt_lst ) ) ) ( setq ) ) ) ) ) ( setq p_lst ( cddr p_lst )) ) ) ) ( trans ( cdar p_lst ) ent 0 ) ) ( * dist ( setq n ( 1+ n ))) ) ) 0 Lst ( cons ( trans ( vlax-curve-getPointAtDist ( vlax-curve-getEndParam obj ) ) ) ( vlax-curve-getDistAtPoint ( trans ( cdaddr p_lst ) ent 0 ) ) ( vlax-curve-getDistAtParam ) ) ( if ( /= 0 ( cdadr p_lst )) ( progn ( setq prec ( 1+ ( fix ( * 25 ( sqrt ( abs ( cdadr p_lst ))))))ĭist ( / ( - ( if ( cdaddr p_lst ) ( vlax-curve-getDistAtPoint ( cons ( append ( cdr ( assoc 10 p_lst )) ( list ( cdr ( assoc 38 ( entget ent )))) ) ) ) ) ) ( T ( setq p_lst ( vl-remove-if-not ' ( lambda ( x ) ( or ( = ( car x ) 10 ) ( = ( car x ) 42 ) ) ) ( entget ent ) ) ) ( while p_lst ( cons ( trans ( vlax-curve-getPointAtDist obj ( * dist ( setq n ( 1+ n )))) 0 ( vlax-get obj 'Normal ) ) OB2WO (gile) -Gilles Chanteau- 10/03/07 Creates a "Wipeout" from an object (circle, ellipse, or polyline with arcs) Works whatever the current ucs and object OCS ( defun c:ob2wo ( / ent lst nor ) ( vl-load-com ) ( if ( and ( setq ent ( car ( entsel ))) ( member ( cdr ( assoc 0 ( entget ent ))) ' ( "CIRCLE" "ELLIPSE" "LWPOLYLINE" ) ) ( setq lst ( ent2ptlst ent )) ( setq nor ( cdr ( assoc 210 ( entget ent )))) ) ( progn ( vla-StartundoMark ( vla-get-ActiveDocument ( vlax-get-acad-object )) ) ( makeWipeout lst nor ) ( initget "Yes No" ) ( if ( = ( getkword "\nDelete source object? : " ) "Yes" ) ( entdel ent ) ) ( vla-EndundoMark ( vla-get-ActiveDocument ( vlax-get-acad-object )) ) ) ) ) ENT2PTLST Returns the vertices list of the polygon figuring the curve object Coordinates defined in OCS ( defun ent2ptlst (ent / obj dist n lst p_lst prec ) ( vl-load-com ) ( if ( = ( type ent ) 'ENAME ) ( setq obj ( vlax-ename->vla-object ent )) ) ( cond (( member ( cdr ( assoc 0 ( entget ent ))) ' ( "CIRCLE" "ELLIPSE" )) ( setq dist ( / ( vlax-curve-getDistAtParam select “Yes” or “No” to erase the existing object.Select object to turn into wipeout (Circle, Ellipse, Polyline).It will work on olylines, circles and ellipses. It also gives you an option to erase the existing object after it makes the wipeout. This great routine allows you to select an existing object that is curved and turn it into a wipeout. If you’ve ever used wipeouts in order to mask something in your drawing, you already know that you cant used curved objects.












Load autocad lisp