Page 1 of 4

Arch Window - Glass Panel Area etc in Python Script?

Posted: Fri Nov 17, 2017 12:50 pm
by paullee
Hi, anybody tried to extract the Glass Panel information out from Window objects in a Python Script?

Likewise, frame width, frame and glass thickness, offset... those had been defined in the Windows Sketch?

Thanks for any idea!


p.s.
I can find the whole Window Area, Height, Width, Louvre Width, at most WindowParts, and solids of sub-objects...

https://forum.freecadweb.org/viewtopic.php?t=4741

Code: Select all

    if Draft.getType(obj) == "Window":
        if len(obj.Shape.Solids) > 1:
            for solid in obj.Shape.Solids:
Screenshot from 2017-11-17 20-36-14.png
Screenshot from 2017-11-17 20-36-14.png (264.03 KiB) Viewed 3849 times

OS: Linux
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12595 (Git)
Build type: None
Branch: master
Hash: 8c7bb0cd551cf11551ff71d716a16211c6d5e13d
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: English/UnitedStates (en_US)

Re: Arch Window - Glass Panel Area etc in Python Script?

Posted: Sat Nov 18, 2017 12:37 am
by regis
I can't ever seem to the get the Windows elevation symbols, the rotation of opening angle, and the floor plan opening symbol representation as I see on your picture.

Re: Arch Window - Glass Panel Area etc in Python Script?

Posted: Sat Nov 18, 2017 8:19 am
by paullee
regis wrote: Sat Nov 18, 2017 12:37 am I can't ever seem to the get the Windows elevation symbols, the rotation of opening angle, and the floor plan opening symbol representation as I see on your picture.
Yes, a little bit tricky.

In short -

- Same for Window and Door (same object type)
- Create / use an existing window/door object FIRST
Then,
- In Data Property tab - Opening - set to something like 100 (%)
- Open the win/door edit box
- Select the Component you want to be operable - Edit
- Find Hinge field - select the 'hinge' edge as indicate - click 'Get Selected Edge'
- In Opening Mode - select what fit you
- Update Component
- Close

Done (or need recompute)

Re: Arch Window - Glass Panel Area etc in Python Script?

Posted: Sat Nov 18, 2017 5:03 pm
by regis
Still not sure but I seem to be getting erros.

Re: Arch Window - Glass Panel Area etc in Python Script?

Posted: Sat Nov 18, 2017 5:37 pm
by paullee
regis wrote: Sat Nov 18, 2017 5:03 pm Still not sure but I seem to be getting erros.
You sure have the hinge edge selected?

Try a win/door w/o error first.

Maybe i can try your file.

Re: Arch Window - Glass Panel Area etc in Python Script?

Posted: Sat Nov 18, 2017 7:30 pm
by regis
still not sure what steps i'm missing. I remember that one time it worked, but ever since I've never had any luck with it.

Re: Arch Window - Glass Panel Area etc in Python Script?

Posted: Sat Nov 18, 2017 11:02 pm
by paullee
regis wrote: Sat Nov 18, 2017 7:30 pm still not sure what steps i'm missing. I remember that one time it worked, but ever since I've never had any luck with it.
Hi, after checking the file, I see there are more things to notice in the workflow underlined &/ bold below :)


- Same for Window and Door (same object type)
- Create / use an existing window/door object FIRST
(as some fields below can't be input in the creation 'wizard')

Then,
- In Data Property tab - Opening - set to something like 100 (%)
- (your screencapture indicates) Symbol Elevation / Plan - set to True as desired
- Open the win/door edit box
- Select the Component you want to be operable - Edit
- Find Hinge field - select the 'hinge' edge as indicate - click 'Get Selected Edge'
(Select the edge of the underlying sketch, not any other edge of other/wall object i think)
(Better, select the edge of the component - e.g. edge defining the glass panel)

*[ You and I both use a fixed window in the test, not quite 'correct' in reality - though either/both the fixed frame / glass would 'open' but look strange on screencapture :) ]
- In Opening Mode (of the selected component) - select what fit you
- Update Component
- Close

You have something like Edge17, Edge 32 selected for the hinge which seem not the edge of the sketch.


BTW, in fact, I want the door and window 'triangle' opening line inverted (upside down for top hung window / handed for door) as convention is different here... But find no way :!:


Screenshot from 2017-11-19 06-47-58.png
Screenshot from 2017-11-19 06-47-58.png (188.76 KiB) Viewed 3727 times

Re: Arch Window - Glass Panel Area etc in Python Script?

Posted: Sun Nov 19, 2017 12:02 am
by regis
paullee wrote: Sat Nov 18, 2017 11:02 pm (Select the edge of the underlying sketch, not any other edge of other/wall object i think)
(Better, select the edge of the component - e.g. edge defining the glass panel)
Yeah that is the crucial detail in the whole equation.
Finally got it. Thanks a bunch. I feel as thought the system is not very straightforward althought this way of doing things gives the proper degree of control.

Re: Arch Window - Glass Panel Area etc in Python Script?

Posted: Sun Nov 19, 2017 12:35 am
by paullee
regis wrote: Sun Nov 19, 2017 12:02 am Yeah that is the crucial detail in the whole equation.
Finally got it. Thanks a bunch. I feel as thought the system is not very straightforward althought this way of doing things gives the proper degree of control.
Lot of trial and error to get these steps - somehow I remember piece of information here and there in the wiki / discussion / blog etc.

Re: Arch Window - Glass Panel Area etc in Python Script?

Posted: Sun Nov 19, 2017 12:55 am
by regis
I see you've been playing with spreadsheets and lists.
You see the brick walls i've been creating, althought haven't yet put any thoughts into it, i'm wondering about ways to put that in a document in a useful way.
There are trimmed bricks, and there are full lenght bricks. but how do you just select and entire wall of bricks, and have the spreadsheet organise the iformation so that the contractor/client/builder, will know how many prefabricated brick needs to be be made or brought to site.
Any good ideas will be welcomed.
Hehe this is probably not the place to post about bricks, when this is about Arch Windows. :D :D