[Solved] Help to offset a line in Arch WB
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
[Solved] Help to offset a line in Arch WB
Hi,
In Arch WB:
1. I drew a Line
2. Selected it
3. Click Offset tool
Why it tells me: Either Part.Wire or Part.Edges should be provided, returning None
The line is: FreeCAD.ActiveDocument.addObject("Part::Line", "Line")
How do I change Part::Line to Part.Wire?
or which tool draws Part.Wire directly?
Regards,
John
In Arch WB:
1. I drew a Line
2. Selected it
3. Click Offset tool
Why it tells me: Either Part.Wire or Part.Edges should be provided, returning None
The line is: FreeCAD.ActiveDocument.addObject("Part::Line", "Line")
How do I change Part::Line to Part.Wire?
or which tool draws Part.Wire directly?
Regards,
John
Last edited by johnwang on Thu Dec 09, 2021 11:28 am, edited 1 time in total.
Re: Help to offset a line in Arch WB
You probably need to uncheck: Edit → Preferences... → Draft → General settings → Use Part Primitives when available
But IMO the Draft_Offset command should be able to handle a Part_Line. So that would need to be fixed.
But IMO the Draft_Offset command should be able to handle a Part_Line. So that would need to be fixed.
Re: Help to offset a line in Arch WB
Wow, that's quick
Re: Help to offset a line in Arch WB
I overwrote that two py files. Got this message:
Code: Select all
09:05:29 Loading GUI of Sketcher module... done
09:05:29 ----------------
09:05:29 GuiCommand: Line
09:05:29 Pick first point
09:05:29 Pick next point
09:05:40 ----------------
09:05:40 GuiCommand: Offset
09:05:40 Pick distance
09:05:42 the offset tool is currently unable to offset a non-Draft object directly - Creating a copy
09:05:42 something wrong with firstDir
09:05:42 Traceback (most recent call last):
File "H:\FreeCAD_0.20.26155_Win-LPv12.5.4_vc17.x-x86-64\Mod\Draft\draftutils\todo.py", line 167, in doTasks
Gui.doCommand(string)
File "<string>", line 1, in <module>
File "H:\FreeCAD_0.20.26155_Win-LPv12.5.4_vc17.x-x86-64\Mod\Draft\draftfunctions\offset.py", line 136, in offset
newobj.Shape = DraftGeomUtils.offsetWire(obj.Shape,delta,occ=True)
TypeError: {'sclassname': 'class Base::TypeError', 'sErrMsg': "type must be 'Shape', not NoneType", 'sfile': '', 'iline': 0, 'sfunction': '', 'swhat': "type must be 'Shape', not NoneType", 'btranslatable': False, 'breported': False}
09:05:42 Traceback (most recent call last):
File "H:\FreeCAD_0.20.26155_Win-LPv12.5.4_vc17.x-x86-64\Mod\Draft\draftutils\todo.py", line 167, in doTasks
Gui.doCommand(string)
File "<string>", line 1, in <module>
File "H:\FreeCAD_0.20.26155_Win-LPv12.5.4_vc17.x-x86-64\Mod\Draft\draftfunctions\offset.py", line 136, in offset
newobj.Shape = DraftGeomUtils.offsetWire(obj.Shape,delta,occ=True)
TypeError: {'sclassname': 'class Base::TypeError', 'sErrMsg': "type must be 'Shape', not NoneType", 'sfile': '', 'iline': 0, 'sfunction': '', 'swhat': "type must be 'Shape', not NoneType", 'btranslatable': False, 'breported': False}
09:05:42 ToDo.doTasks, Unexpected error:
<class 'TypeError'>
in ['offst = Draft.offset(FreeCAD.ActiveDocument.Line, FreeCAD.Vector(-10.67492775865126, 18.22273918977719, 30.16078215968867), copy=True, occ=True)', 'FreeCAD.ActiveDocument.recompute()']
Code: Select all
OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.26155 (Git)
Build type: Release
Branch: master
Hash: 0926a4148bcff11249fd4f56bc30256102ffe105
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: English/United States (en_US)
Re: Help to offset a line in Arch WB
The problem is caused by occ=True and not related to this PR.
https://wiki.freecadweb.org/Draft_Offset wrote:OCC-style ... only works for planar Draft objects with at least two straight edges.
Re: Help to offset a line in Arch WB
Where is this occ setting? I can't find it under Draft Preferences.
BTW: I was trying Design456. It has one line 'import occ' and my system reports there is no module named occ. Maybe my FC version has problem with occ not setting right.
Re: Help to offset a line in Arch WB
I saw this 'occ=True':
Code: Select all
>>> Gui.runCommand('Draft_Offset',0)
>>> offst = Draft.offset(FreeCAD.ActiveDocument.Line, FreeCAD.Vector(-7.045367820091163, 10.100797605951575, 17.52369468323241), copy=True, occ=True)
Re: Help to offset a line in Arch WB
- Attachments
-
- task-panel-occ-style.png (7.31 KiB) Viewed 1683 times