Face Placement cannot be changed

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
pate
Posts: 11
Joined: Mon Mar 15, 2021 8:47 am

Face Placement cannot be changed

Post by pate »

OS: Windows 10 Version 2009
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24276 (Git)
Build type: Release
Branch: releases/FreeCAD-0-19
Hash: a88db11e0a908f6e38f92bfc5187b13ebe470438
Python version: 3.8.6+
Qt version: 5.15.1
Coin version: 4.0.1
OCC version: 7.5.0
Locale: Finnish/Finland (fi_FI)


I am a new python user. It's very interesting. I've only been testing it for one month. I have been practicing and using Freecad for a few years. I mainly use a 2D cad and manage my client’s Aras PDM system.

I have been able to create a wide variety of components with python code. Now I have run into an unresolved problem. I copied the Python code from the python console and modified it to fit. The code creates a new file, a template, retrieves the cross section of the dxf file and creates a face from it.

The face should then be turned to the correct position and extruded. This will be a problem. The code doesn't go right at once, but if I export lines 1-60 and then lines 61-100 to the python console, it works.

What am I doing wrong?

PS. My client has hundreds or thousands of these dxf clip files undergoing an extrusion operation.
Attachments
P_test3011A.dxf
(374.45 KiB) Downloaded 18 times
Face_test.py
(4.11 KiB) Downloaded 20 times
TheMarkster
Veteran
Posts: 5513
Joined: Thu Apr 05, 2018 1:53 am

Re: Face Placement cannot be changed

Post by TheMarkster »

Add this line:

Code: Select all

FreeCADGui.updateGui()
pate
Posts: 11
Joined: Mon Mar 15, 2021 8:47 am

Re: Face Placement cannot be changed

Post by pate »

Great, now it works. Thank you. :D :D :D
Now I can move forward a lot.
Post Reply