Search found 6162 matches

by Roy_043
Fri Jan 27, 2023 7:08 pm
Forum: Python scripting and macros
Topic: How to check if an object has been deleted?
Replies: 25
Views: 1094

Re: How to check if an object has been deleted?

I see no difference in behavior. The cloned part has the same color as the original one Create a Part_Box . Change the color of some of its faces with Part_FaceColors . Create a Draft_Clone . Result without the workaround: the clone does not display the correct face colors (DiffuseColor). Although ...
by Roy_043
Fri Jan 27, 2023 7:02 pm
Forum: Python scripting and macros
Topic: How to check if an object has been deleted?
Replies: 25
Views: 1094

Re: How to check if an object has been deleted?

chennes wrote: Fri Jan 27, 2023 1:41 pm I think this should work
Thank you. I'll have a play with this.
by Roy_043
Fri Jan 27, 2023 1:52 pm
Forum: Python scripting and macros
Topic: How to check if an object has been deleted?
Replies: 25
Views: 1094

Re: How to check if an object has been deleted?

onekk wrote: Fri Jan 27, 2023 1:21 pm

Code: Select all

    objects = doc.Objects
    for obj in objects:
        if obj.TypeId in ("App::"):
            pass
        else:
            doc.removeObject(obj.Name)
I don't think this can work. Are you sure this is the correct code?
by Roy_043
Fri Jan 27, 2023 1:14 pm
Forum: Developers corner
Topic: ci/gitlab/gitlab.com not triggered?
Replies: 2
Views: 139

ci/gitlab/gitlab.com not triggered?

It seems that ci/gitlab/gitlab.com is not triggered anymore. Is this a known issue?
by Roy_043
Fri Jan 27, 2023 10:26 am
Forum: Help on using FreeCAD
Topic: Select an Edge, Face or Body from an Active Body???
Replies: 8
Views: 491

Re: Select an Edge, Face or Body from an Active Body???

You get this warning when the document contains more than one Body, and the selected subelement does not belong to the active Body. You need to activate the correct Body first. See PartDesign_Body#Active_status.
by Roy_043
Fri Jan 27, 2023 9:58 am
Forum: Open discussion
Topic: request for input: default for NaviCube font
Replies: 11
Views: 626

Re: request for input: default for NaviCube font

I think this is the related code: https://github.com/FreeCAD/FreeCAD/blob/588f2d50e4e108299a754e5c229cdc396342d2dd/src/Mod/TechDraw/Gui/AppTechDrawGui.cpp#L79 Note that there are other fonts already available in the FreeCAD package: \bin\Lib\site-packages\matplotlib\mpl-data\fonts\ttf But maybe thes...
by Roy_043
Fri Jan 27, 2023 9:42 am
Forum: Python scripting and macros
Topic: How to check if an object has been deleted?
Replies: 25
Views: 1094

Re: How to check if an object has been deleted?

I fully agree that workarounds should be avoided. But in this case a workaround helps fix an almost 5 year old bug (issue #5765). I can create an issue for the DiffuseColor update issue if that helps.
by Roy_043
Fri Jan 27, 2023 12:03 am
Forum: Forum français
Topic: Macro pour obtenir un stl avec des arrondis parfaits et piloter octoprint
Replies: 134
Views: 11206

Re: Macro pour obtenir un stl avec des arrondis parfaits et piloter octoprint

The partial code issue should be solved now. The piping characters were indeed to blame.
by Roy_043
Thu Jan 26, 2023 11:48 pm
Forum: Python scripting and macros
Topic: How to check if an object has been deleted?
Replies: 25
Views: 1094

Re: How to check if an object has been deleted?

Thanks again. I can't get this to work though: obj = Draft.make_clone(box) if App.GuiUp: from PySide import QtCore i = 0 def process_events(self): QtCore.QCoreApplication.processEvents(QtCore.QEventLoop.AllEvents, 10) while i < 10: i += 1 _msg(str(i)) QtCore.QTimer.singleShot(100, self.process_event...
by Roy_043
Thu Jan 26, 2023 10:34 pm
Forum: Python scripting and macros
Topic: How to check if an object has been deleted?
Replies: 25
Views: 1094

Re: How to check if an object has been deleted?

Thanks you! That can indeed work. My first try (a bit cryptic, but so is the DiffuseColor workaround): if App.GuiUp: diffuse_col = [(0.0, 0.0, 1.0, 0.0), (0.0, 1.0, 0.0, 0.0), (1.0, 0.0, 0.0, 0.0), (0.0, 0.0, 1.0, 0.0), (0.0, 1.0, 0.0, 0.0), (1.0, 0.0, 0.0, 0.0)] box.ViewObject.DiffuseColor = diffus...