Search found 5158 matches

Go to advanced search

by openBrain
Thu Jan 21, 2021 3:59 pm
Forum: Python scripting and macros
Topic: Selecting a part from hierarchy of assemblies
Replies: 51
Views: 1618

Re: Selecting a part from hierarchy of assemblies

xbit wrote:
Thu Jan 21, 2021 1:53 pm
Anyway, i run the code and i get a weird error.

Code: Select all

Segmentation fault (core dumped)
Why do i get weird memory segmentation errors when trying to run this.
I don't know, no error here (I tested it).
You can remove random lines, or add 'print' lines to see where it fails.
by openBrain
Thu Jan 21, 2021 12:11 pm
Forum: Python scripting and macros
Topic: Selecting a part from hierarchy of assemblies
Replies: 51
Views: 1618

Re: Selecting a part from hierarchy of assemblies

Unfortunately, your snippet did not work. And with my attempt, that makes it two different aproaches that did not work. Works good here. You may have to had some extra lines to manage the rotation center though. ;) [/quote] 1. Why are you using a scaling_matrix, for rotation only operations? [/quot...
by openBrain
Thu Jan 21, 2021 9:56 am
Forum: Python scripting and macros
Topic: Recalculate some objects through python
Replies: 4
Views: 138

Re: Recalculate some objects through python

To disable global recompute at document level :

Code: Select all

App.ActiveDocument.RecomputesFrozen = True
Set to 'False' to enable again

Then for each object you can call :

Code: Select all

OBJECT.recompute()
If you want a recursive recompute (ie. children are recomputed) :

Code: Select all

OBJECT.recompute(True)
by openBrain
Wed Jan 20, 2021 2:30 pm
Forum: Help on using FreeCAD
Topic: Where does FreeCAD look for the decimal separator?
Replies: 4
Views: 166

Re: Where does FreeCAD look for the decimal separator?

Code: Select all

>>> from PySide2 import QtCore
>>> QtCore.QLocale('de_DE').decimalPoint()
','
>>> QtCore.QLocale('de_DE').groupSeparator()
'.'
by openBrain
Tue Jan 19, 2021 11:38 pm
Forum: Python scripting and macros
Topic: Selecting a part from hierarchy of assemblies
Replies: 51
Views: 1618

Re: Selecting a part from hierarchy of assemblies

If i also want to perform translation and rotation to the selected part, what would you suggest, in terms of API? Could you guide me on where to look? I don't know what function to use for translation - nor do know where to look exactly. You can add functions to your matrix (not tested) : scaling_m...
by openBrain
Tue Jan 19, 2021 6:22 pm
Forum: Developers corner
Topic: Checking for keyboard shortcut availability?
Replies: 7
Views: 162

Re: Checking for keyboard shortcut availability?

They only have to work in the 3D view, so I was hoping that the Coin key press events would supersede the Qt, but they don't. So it looks like I'm going to have to burrow in deeper. I think it's the opposite. Qt can 'steal' the key events and not propagate them to Coin. But the opposite is IMO not ...
by openBrain
Tue Jan 19, 2021 6:01 pm
Forum: Python scripting and macros
Topic: Plane perpendicular to line(a,b)
Replies: 1
Views: 70

Re: Plane perpendicular to line(a,b)

Considering A & B are of App.Vector type.
Create a standard plane 'myPlane' (located at 0,0,0 and normal to Z axis) then

Code: Select all

myPlane.Placement = App.Placement(A, App.Rotation(App.Vector(0,0,1), B-A))
by openBrain
Tue Jan 19, 2021 5:51 pm
Forum: Developers corner
Topic: Checking for keyboard shortcut availability?
Replies: 7
Views: 162

Re: Checking for keyboard shortcut availability?

I basically don't know any way to say to Qt something like 'temporarily ignore all shortcuts but mine'. :) There is a risk that a shortcut you define collides with an application shortcut. The only thing I can think to ATM is to create your shortcuts with a shortcutContext set to 'Qt::WidgetShortcut...
by openBrain
Tue Jan 19, 2021 5:34 pm
Forum: Developers corner
Topic: Checking for keyboard shortcut availability?
Replies: 7
Views: 162

Re: Checking for keyboard shortcut availability?

Is there a way to check to see whether a particular keyboard shortcut is available? I can get a list of commands out of the CommandManager, but I can't see how to figure out what their shortcuts are. You could find useful information around this post . ;) As a corollary: is there a built-in mechani...
by openBrain
Tue Jan 19, 2021 5:25 pm
Forum: Forum français
Topic: Défit utile (peut-être) : de l'image au volume.
Replies: 26
Views: 728

Re: Défit utile (peut-être) : de l'image au volume.

Une question à tous cependant : l'absence de l'ellipse aurait-elle compliqué la détermination des dimensions ? Non. Le fait de savoir que c'est une projection dimétrique + une seule distance connue est suffisant. Un peu de temps, donc un peu de géométrie théorique. Pour ceux qui ont une aversion au...

Go to advanced search