I am using the following addin macro often:
https://wiki.freecad.org/Macro_Cut_Line
It works good but begins at the object start end.
Can someone help tweak it so if I click near one end it will start at the nearest end selected.
Modifying it is still higher than my current python level.
[Solved] Modify Macro Cut Line
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
[Solved] Modify Macro Cut Line
- Attachments
-
- cutline.png (40.38 KiB) Viewed 260 times
Last edited by jfc4120 on Thu Mar 16, 2023 2:18 am, edited 1 time in total.
Re: Modify Macro Cut Line
I resolved it, not the best way, but I modifed this section:
Attached is whole file, I am not certain about the modifications in the second section, but it works for my use case:
Please post here any fixes.
Code: Select all
KOUNT = 0
for p in points:
#####added
KOUNT = KOUNT + 1
#####added
if createPoint != 0:
#Draft.makePoint(p.x, p.y, p.z)
###added
if KOUNT == 1:
multlist = [[p.x, p.y, p.z]]
if KOUNT > 1:
multlist.append([p.x, p.y, p.z])
####added
FreeCAD.Console.PrintMessage(
str(compteur) + " X" + str(p.x) + " Y" + str(p.y) + " Z" + str(p.z) + "\n")
# print( compteur," X", p.x, " Y", p.y, " Z", p.z)
print('p', p)
print('multilist', multlist)
print('kount', KOUNT)
K = KOUNT
for i in range(0, KOUNT):
K = K - 1 ################ points in reverse
print('k', K)
Draft.makePoint(multlist[K][0], multlist[K][1], multlist[K][2])
print('ml5', multlist[K][0])
Please post here any fixes.
- Attachments
-
- cut_line_regular_backwards.py
- (5.41 KiB) Downloaded 6 times