Jump to content
bn-top

Lisp per assegnare una sezione trasversale simmetrica o non simmetrica a più sementi o polilinee nel piano o nello spazio


Recommended Posts

bn-top
(defun c:shp-sweep-m ( / *adoc* shp ss i curve shpn )

  (vl-load-com)

  (vla-startundomark (setq *adoc* (vla-get-activedocument (vlax-get-acad-object))))
  (prompt "\nPick unit shape for sweep along curves : ")
  (while (not (ssget "_+.:E:S:L" (list '(-4 . "<or") '(-4 . "<and") '(0 . "*POLYLINE") '(-4 . "<or") '(70 . 1) '(70 . 3) '(70 . 5) '(70 . 9) '(70 . 13) '(70 . 129) '(70 . 131) '(70 . 133) '(-4 . "or>") '(-4 . "and>") '(-4 . "<and") '(0 . "SPLINE") '(-4 . "<or") '(70 . 3107) '(70 . 2051) '(70 . 1067) '(70 . 11) '(-4 . "or>") '(-4 . "and>") '(-4 . "<and") '(0 . "ELLIPSE") '(-4 . "<and") '(41 . 0.0) '(42 . 6.28319) '(-4 . "and>") '(-4 . "and>") '(0 . "CIRCLE,REGION") '(-4 . "or>"))))
    (prompt "\nEmpty sel.set... Please pick unit shape for sweep along curves again...")
  )
  (setq shp (ssname (ssget "_P") 0))
  (prompt "\nSelect curve entities to make sweeps with unit shape...")
  (if (setq ss (ssget '((0 . "*POLYLINE,LINE,SPLINE,ARC,CIRCLE,ELLIPSE,HELIX"))))
    (repeat (setq i (sslength ss))
      (setq curve (ssname ss (setq i (1- i))))
      (setq shpn (vlax-vla-object->ename (vla-copy (vlax-ename->vla-object shp))))
      (command "_.SWEEP" shpn "" curve)
      (while (< 0 (getvar 'cmdactive)) (command ""))
    )
    (prompt "\nEmpty sel.set... Please select curve entity(ies) next time when routine is started again...")
  )
  (vla-endundomark *adoc*)
  (princ)
)

 

Preso da qui

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/multiple-sweep/td-p/6357009

 

Cercando su google "multiple sweep lisp autocad" se ne trovano tanti

 

 

: :  Youtube : : 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...