Help operator in Part Module

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
anhtubkhn
Posts: 4
Joined: Tue Jan 22, 2019 7:52 am

Help operator in Part Module

Post by anhtubkhn »

Hi everyone, I'm a newbie in FreeCAD. I am trying to create a 3D object from python script using Part Module.
I have created 3 solid objects (solid0, solid1, solid2) (the solid1 and solid2 are solid1's holes) Image.
When I apply solid0.cut(solid2), it's ok Image
But if I apply solid0.cut(solid1), The result is Image

I don't know what is the error. And this is the script to create solid0, solid1 and solid2
ScriptTest.txt
(15.72 KiB) Downloaded 36 times
[/url].

Thank you for the help!
Attachments
solid1_2.PNG
solid1_2.PNG (6.51 KiB) Viewed 532 times
solid_cut2.PNG
solid_cut2.PNG (7.32 KiB) Viewed 532 times
solid_cut.PNG
solid_cut.PNG (8.04 KiB) Viewed 532 times
solid0.PNG
solid0.PNG (6.49 KiB) Viewed 532 times
Last edited by anhtubkhn on Wed Jan 23, 2019 8:04 am, edited 1 time in total.
chrisb
Veteran
Posts: 54213
Joined: Tue Mar 17, 2015 9:14 am

Re: Help operator in Part Module

Post by chrisb »

Perhaps it's only a visibility issue?

If I run your script on a new empty document the first line yields already an error:

Code: Select all

Traceback (most recent call last):
  File "<input>", line 1, in <module>
NameError: name 'Base' is not defined
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
anhtubkhn
Posts: 4
Joined: Tue Jan 22, 2019 7:52 am

Re: Help operator in Part Module

Post by anhtubkhn »

chrisb wrote: Tue Jan 22, 2019 9:53 am Perhaps it's only a visibility issue?

If I run your script on a new empty document the first line yields already an error:

Code: Select all

Traceback (most recent call last):
  File "<input>", line 1, in <module>
NameError: name 'Base' is not defined
ah I forgot import Base. I have updated script already.
it's not only visibility. Because when I export to a dxf and import to AutoCAD. it's same
anhtubkhn
Posts: 4
Joined: Tue Jan 22, 2019 7:52 am

Re: Help operator in Part Module

Post by anhtubkhn »

Hello everyone, Please give me advice if you have any idea
Post Reply