FC 0.18 module 'Draft' has no attribute 'make_wire'

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
Oli772
Posts: 26
Joined: Wed Apr 27, 2022 2:35 pm

FC 0.18 module 'Draft' has no attribute 'make_wire'

Post by Oli772 »

Hello,
I have a script which worked well with FC 0.19 but failed with FC 0.18. I get the following error:
Exception while processing file: sript.py [module 'Draft' has no attribute 'make_wire']
here below is the piece of code.
what could be the issue ?
thanks in advance for your help

Code: Select all

from __future__ import unicode_literals
__title__= "_"
__author__= "_"
__date__= "_"
__version__= "01"

import sys
# add folder containing FreeCAD.pyd, FreeCADGui.pyd to sys.path
sys.path.append("/usr/lib/freecad/lib")

import FreeCAD, FreeCADGui
import ImportGui
from FreeCAD import Base
import Draft, PartDesign, Part, Import

doc = App.newDocument()
fichier = "/home/user/Documents/project/geometry/points.txt"                         
file = open(fichier, "r")                                  
wire = []
X=Y=Z = 0.0

for ligne in file:
    coordinates = ligne.split()
    try:                                                    # for format PCD ignore the header
        X,Y,Z = coordinates                                           # separate the coordinates
        print(X," ",Y," ",Z)
        wire.append(FreeCAD.Vector(float(X),float(Y),float(Z))) 		# append the coordinates
    except Exception:
        None
file.close()
# wire creation
Draft.make_wire(wire, closed=True, face=True, support=None)   	# create the wire closed
doc.recompute()
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: FC 0.18 module 'Draft' has no attribute 'make_wire'

Post by Roy_043 »

In V0.18 you have to use makeWire. This will also work in V0.19.
Oli772
Posts: 26
Joined: Wed Apr 27, 2022 2:35 pm

Re: FC 0.18 module 'Draft' has no attribute 'make_wire'

Post by Oli772 »

thank you
Post Reply