Revolve Mesh Command Help

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello
I wrote a lisp which Revolves 3DPolyline around a line and creates 3DMesh Object.
But sometimes it puts some points out of their coordinates.
Coul you advise please.
(defun c:revmesh(/ Pl-Type Pl-Name Li-Type Li-Name Li-Opt)
(setq Pl-Type nil);ТИП Полилиния
(while (/= Pl-Type "POLYLINE")
(setq Pl-Name (car (entsel "\nSelect a Polyline: ")))
(setq Pl-Type (cdr(nth 1 (entget Pl-Name))))
(cond
((/= Pl-Type "POLYLINE")(print "Select 3D Polyline Pl-ease"))
)
)
(setq Li-Type nil)
(while (/= Li-Type "LINE")
(setq Li-Name (car (entsel "\nSelect a Line: ")))
(setq Li-Type (cdr(nth 1 (entget Li-Name))))
(cond
((/= Li-Type "LINE")(print "Select a Line Please"))
)
)
(setq Li-Opt (entget Li-Name))
(command "ucs" "za" (cdr(assoc 10 Li-Opt)) (cdr(assoc 11 Li-Opt)))
(setq Coord-List '());Список координат
(repeat 12
(setq Coord-List (cons (vlax-safearray->list (vlax-variant-value (vla-get-coordinates (vlax-ename->vla-object PL-Name)))) Coord-List))
(command "rotate" Pl-Name "" "0,0,0" "30")
)
(setq New-List nil)
(setq numb 0)
(setq ppp 0)
(setq New-New-List nil)
(while (/= (nth ppp Coord-List) nil)
(setq New-List (append (nth ppp Coord-List) New-List))
(setq ppp (+ ppp 1))
)
(while (/= (nth numb New-List) nil)
(setq New-New-List(cons (strcat(rtos(nth numb New-List))","(rtos(nth (+ numb 1) New-List))","(rtos(nth (+ numb 2) New-List)))New-New-List))
(setq numb (+ 3 numb))
)
;(setq Coord-List (mapcar' vl-princ-to-string Coord-List))
;;(setq Coord-List (mapcar'(lambda(a)(vl-string-trim "()" a))Coord-List))
(setq List-Length (length New-New-List))
(setq List-Length-12 (/ List-Length 12))
(command "_3dmesh" "12" List-Length-12
;(command "point"
(mapcar 'command New-New-List)
)
(command "pedit" "last" "nclose" "mclose" "exit")
)