Revolve Mesh Command Help

Revolve Mesh Command Help

Anonymous
Not applicable
460 Views
1 Reply
Message 1 of 2

Revolve Mesh Command Help

Anonymous
Not applicable

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")
)

0 Likes
461 Views
1 Reply
Reply (1)
Message 2 of 2

marko_ribar
Advisor
Advisor

Just a hunch...

Try converting 3dpolyline into its corresponding spline prior doing creating mesh - use spline instead of 3dpolyline... Should do it corrctly...

For conversion look into attchments posted in this topic :

https://www.theswamp.org/index.php?topic=49959.0

 

(You have to have www.theswamp.org membership to access the topic - key routine is 2ndss2spls.lsp and there are also important ones that follows in next post - I mean important to 2ndss2spls.lsp - Suggestion is to load them all before applying (c:2ndss2spls) inside your code...)

 

HTH, M.R.

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes