pyautocad icon indicating copy to clipboard operation
pyautocad copied to clipboard

howto polyline?

Open nortikin opened this issue 6 years ago • 4 comments

m.AddPolyline((APoint(0,0),APoint(-1000,-1000),APoint(5000,-5000))) Traceback (most recent call last): File "", line 1, in File "C:\Users\P1\AppData\Local\Programs\Python\Python36\lib\site-packages\comtypes\client\lazybind.py", line 182, in caller return self._comobj._invoke(descr.memid, descr.invkind, 0, *args) File "C:\Users\P1\AppData\Local\Programs\Python\Python36\lib\site-packages\comtypes\automation.py", line 729, in _invoke dp, var, None, argerr) _ctypes.COMError: (-2147352567, 'Ошибка.', (None, None, None, 0, None))

nortikin avatar Feb 15 '19 11:02 nortikin

from pyautocad import Autocad
import array

acad = Autocad(create_if_not_exists=True)

points_2d = [0, 0, 1, 1, 2, 1]
points_double = array.array("d", points_2d)
acad.model.AddLightWeightPolyline(points_double)

points_3d = [0, 0, 0, 1, 1, 0, 2, 1, 0]
points_double = array.array("d", points_3d)
acad.model.AddPolyline(points_double)

FrancoTonutti avatar May 06 '19 17:05 FrancoTonutti

from pyautocad import Autocad
import array

acad = Autocad(create_if_not_exists=True)

points_2d = [0, 0, 1, 1, 2, 1]
points_double = array.array("d", points_2d)
acad.model.AddLightWeightPolyline(points_double)

points_3d = [0, 0, 0, 1, 1, 0, 2, 1, 0]
points_double = array.array("d", points_3d)
acad.model.AddPolyline(points_double)

the result is a 2D Polyline... and not a 3D Polyline... ¿is it possible to get it 3D?

iNakel avatar Sep 14 '21 06:09 iNakel

in the end how to choice the “closed”,when finish draw

better319 avatar Sep 01 '23 13:09 better319

in the end how to choice the “closed”,when finish draw

use Closed.. https://help.autodesk.com/view/OARX/2023/ENU/?guid=GUID-5A604B98-B6DE-42C3-97D9-98B8CAEBB507

from pyautocad import Autocad
import array

acad = Autocad(create_if_not_exists=True)

points_3d = [0, 0, 0, 1, 1, 0, 2, 1, 0]
points_double = array.array("d", points_3d)
pline = acad.model.AddPolyline(points_double)
pline.Closed = True

CEXT-Dan avatar Sep 01 '23 22:09 CEXT-Dan