Search found 75 matches

Go to advanced search

by lambda
Sun Jul 19, 2020 5:08 pm
Forum: Developers corner
Topic: Shape.replaceShape() breaks Shape and confuses Shape.check()
Replies: 23
Views: 982

Re: Shape.replaceShape() breaks Shape and confuses Shape.check()

I don't have fully understood how replaceShape is supposed to work. I was for example not able to make it work with Faces or Edges, but just with Vertexes.. and this leads to strange results sometimes, as you were working on the Mesh rather than on the Shape itself! If you replace something other t...
by lambda
Fri Jul 17, 2020 6:03 pm
Forum: Draft, Arch & BIM
Topic: [Feature] Floor Area Calculation + Room Dimension
Replies: 62
Views: 2474

Re: [Feature] Floor Area Calculation + Room Dimension

This is always the same problem, SWH3D, like many BIM apps, makes a lot of assumptions such as: All walls are single-segment, all walls are straight, all walls are vertical, all floors are horizontal, all ceilings are horizontal... Many of these assumptions could easily be false in FreeCAD. This is...
by lambda
Thu Jul 16, 2020 2:24 pm
Forum: Developers corner
Topic: Shape.replaceShape() breaks Shape and confuses Shape.check()
Replies: 23
Views: 982

Re: Shape.replaceShape() breaks Shape and confuses Shape.check()

The documentation is somewhat lacking. For your reference here is an example function, where I got it to work. def snap_by_resize_Zlength(shape, target): replacements = [] candidates = sorted(shape.OuterWire.Edges, key=lambda e: e.BoundBox.ZLength)[-2:] for e in candidates: d = get_distance_vector(e...
by lambda
Wed Jul 15, 2020 9:29 pm
Forum: Developers corner
Topic: Shape.replaceShape() breaks Shape and confuses Shape.check()
Replies: 23
Views: 982

Re: Shape.replaceShape() breaks Shape and confuses Shape.check()

What's your intention with this? To modify general Part::Feature objects in the same way as is possible with Draft objects. Of course having a parametric object like from Draft would be preferable, but you have to work with what you have. :-) I've never seen this used; in most cases if you want to ...
by lambda
Wed Jul 15, 2020 5:01 pm
Forum: Developers corner
Topic: Shape.replaceShape() breaks Shape and confuses Shape.check()
Replies: 23
Views: 982

Shape.replaceShape() breaks Shape and confuses Shape.check()

Hi, it seems any Shape I change with replaceShape() becomes invalid. The attached document as an almost minimal example. I start with a document that contains just one shape. In my case it is a face. Then I have something like this in the python console: >>> r = FreeCAD.ActiveDocument >>> r.Shape.Sh...
by lambda
Tue Jul 07, 2020 2:16 pm
Forum: Draft, Arch & BIM
Topic: Finding objects based on GUID
Replies: 9
Views: 333

Re: Finding objects based on GUID

Sure, I can do that, but it will be very slow on big files.

However I guess this answers my question: There is no such function yet. :-)
by lambda
Thu Jul 02, 2020 4:26 pm
Forum: Draft, Arch & BIM
Topic: Finding objects based on GUID
Replies: 9
Views: 333

Re: Finding objects based on GUID

What I want to do right now is process data from other BIM applications, that don't know about the object names in FreeCAD document, but know the GUID, because they are working on the same IFC file. But I think pretty much everybody using GlobalIds will want to find objects based on them. Even if it...
by lambda
Wed Jul 01, 2020 8:34 pm
Forum: Draft, Arch & BIM
Topic: Finding objects based on GUID
Replies: 9
Views: 333

Re: Finding objects based on GUID

Yes, I know how to do this with objects. ;-) But a GlobalId is a property of an object, not an object itself. I have >>> FreeCAD.ActiveDocument.Wall.GlobalId '2Uv8iBq25ChAfktTCU0To2' So suppose I know '2Uv8iBq25ChAfktTCU0To2', but not to which object it belongs. Is there any way to arrive at 'Wall' ...
by lambda
Wed Jul 01, 2020 7:52 pm
Forum: Draft, Arch & BIM
Topic: Finding objects based on GUID
Replies: 9
Views: 333

Re: Finding objects based on GUID

openBrain wrote:
Wed Jul 01, 2020 12:41 pm
Just use '{document}.{GUID}' to get a pointer. No need to call a function.
I don't know how to translate this into valid syntax.

TIA, Harald

Go to advanced search