Padding more than 1 shape within same sketch

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: Padding more than 1 shape within same sketch

Post by chrisb »

Phhew. I wanted already give up, because I could enter the wire, but the Profile was always empty.
I finally succeeded with this workflow:
- enter the LinkSub editor
- select the sketch, double click in the right part
- enter "Wire1"
- Enter
- And now comes what it needs to succeed: I have to select this line again
- confirm
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: Padding more than 1 shape within same sketch

Post by chrisb »

For the test I started with a single rectangle, which I could pad.
Then I could fiddle with the profile property without the need to have as additional difficulty the Pad dialog open.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Padding more than 1 shape within same sketch

Post by TheMarkster »

chrisb wrote: Sun Jan 02, 2022 10:09 pm Phhew. I wanted already give up, because I could enter the wire, but the Profile was always empty.
I finally succeeded with this workflow:
- enter the LinkSub editor
- select the sketch, double click in the right part
- enter "Wire1"
- Enter
- And now comes what it needs to succeed: I have to select this line again
- confirm
Yes, this also got me when I was first trying this type of edit. You must select again the object before closing the dialog or else it will interpret the object as being deselected.
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Padding more than 1 shape within same sketch

Post by TheMarkster »

drmacro wrote: Sun Jan 02, 2022 7:23 pm Hmm...I could see that you were referencing the wire. How you got to it eluded me.

That said, I found no indication that there was a wire/s in the sketch.

With the sketch open and all geometry selected, I ran a Python script that got the selection object and stopped at a breakpoint.

Here I climbed all over the sub elements, etc. and found no wire. So, the wire/s don't exist when the sketch is open?

The data structure is just convoluted, like a big balloon that people just keep patching with bubblegum. :mrgreen:

And Dorothy says: "Wires, edges, and shapes oh my" :D

And, thanks for the explanation!!
You won't find "Wire1" in the list of SubElementNames returned with getSelectionEx(). You have to parse the edges of all the wires in the object and compare them to the selected edges (such as with edge1.isEqual(edge2)) to work out which wires have been selected. With 3D objects this is further complicated by the fact an edge might belong to more than 1 wire. For example, the front top edge of a cube belongs to 2 wires: the top wire and the front wire.

The open sketch and the closed sketch might indeed have different edges. I have not scripted open sketches much, if any. If you think about it there are edges in the open sketch that don't exist in the closed sketch, for example construction mode edges.

For a closed sketch determining which wire is which might come down to trial and error. You can use WireFilter to see the color coding and determine from that the red wire is Wire1, green is Wire2, etc. Another option: select the sketch, Ctrl+Shift+P, enter in console Part.show(obj.Shape.Wire1,"Wire1"). You can also know which is which if you know the order in which they were created.
Post Reply