I'm trying to create a 3DPoly, but every time it draws it, it's only 2D. Is there a setting I'm missing? There is probably a simple answer, but I can't find it.
newPntList = ((-4.45 -3.511 0.29) (-4.2 -3.511 0) (-4.2 -3.765 0) (-4.45 -3.765 0.29))
I tried:
(apply 'command
(append
'(".3dpoly")
newPntList
'("")
)
)
I even tried:
(setq pnt1 (nth 0 newPntList)
pnt2 (nth 1 newPntList)
pnt3 (nth 2 newPntList)
pnt4 (nth 3 newPntList))
(command "3dpoly" pnt1 pnt2 pnt3 pnt4 "cl" "")
They both create a 2D polyline and disregard the Z from the list.
Can anyone shed some light on this?
Thanks
Solved! Go to Solution.
Solved by Kent1Cooper. Go to Solution.
Worked in Bricscad added "C" so it closes. Tried osnapz 0 or 1 did not make any difference, but ID will show z=0 depending on osnapz but a list of the pline shows Z=0.29.
[I guess OSNAPZ is irrelevant, if it really only affects points returned by Osnapping.]
Both methods work for me, in 3D. [The second one has an extraneous "" at the end -- not needed, because the close option finishes the command.]
Do you perhaps have some running Object snap mode(s) on and any other stuff drawn in the vicinity that it might be Osnapping to?
@mgorecki wrote:I'm trying to create a 3DPoly, but every time it draws it, it's only 2D. Is there a setting I'm missing? There is probably a simple answer...
there always is and free of heck commands
(setq newPntList '((-4.45 -3.511 0.29) (-4.2 -3.511 0) (-4.2 -3.765 0) (-4.45 -3.765 0.29))
newPntList (apply 'append newPntList)
3d_poly (vla-add3dpoly (vla-get-block (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object))))
(vlax-safearray-fill (vlax-make-safearray
vlax-vbdouble
(cons 1 (length newPntList))
)
newPntList
)
)
)
I've used the following successfully.
(command "_3dpoly" )
(while (= (getvar "cmdactive") 1)
(repeat
(setq x (length pntList))
(command "_non" (nth (setq x (- x 1)) pntList))
) ;end repeat
(command "") ;end 3dpoly
) ; end while
I have a command when the code first starts that turns off all of the osnaps. I thought it was off, I must have turned it on to test something and I forgot. Yep, I feel stupid.
Can't find what you're looking for? Ask the community or share your knowledge.