Arch Window - Glass Panel Area etc in Python Script?

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
paullee
Veteran
Posts: 5092
Joined: Wed May 04, 2016 3:58 pm

Arch Window - Glass Panel Area etc in Python Script?

Post 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 3824 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)
User avatar
regis
Posts: 725
Joined: Sun Jul 12, 2015 8:17 am
Contact:

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

Post 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.
paullee
Veteran
Posts: 5092
Joined: Wed May 04, 2016 3:58 pm

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

Post 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)
User avatar
regis
Posts: 725
Joined: Sun Jul 12, 2015 8:17 am
Contact:

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

Post by regis »

Still not sure but I seem to be getting erros.
Attachments
Screenshot from 2017-11-18 12-02-49.png
Screenshot from 2017-11-18 12-02-49.png (308.35 KiB) Viewed 3731 times
paullee
Veteran
Posts: 5092
Joined: Wed May 04, 2016 3:58 pm

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

Post 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.
User avatar
regis
Posts: 725
Joined: Sun Jul 12, 2015 8:17 am
Contact:

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

Post 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.
Attachments
window test.fcstd
(20 KiB) Downloaded 70 times
paullee
Veteran
Posts: 5092
Joined: Wed May 04, 2016 3:58 pm

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

Post 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 3702 times
Attachments
window test_ done.fcstd
(21.02 KiB) Downloaded 84 times
User avatar
regis
Posts: 725
Joined: Sun Jul 12, 2015 8:17 am
Contact:

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

Post 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.
Attachments
Screenshot from 2017-11-18 19-00-19.png
Screenshot from 2017-11-18 19-00-19.png (360.97 KiB) Viewed 3698 times
paullee
Veteran
Posts: 5092
Joined: Wed May 04, 2016 3:58 pm

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

Post 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.
User avatar
regis
Posts: 725
Joined: Sun Jul 12, 2015 8:17 am
Contact:

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

Post 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
Attachments
Screenshot from 2016-12-29 11-42-13.png
Screenshot from 2016-12-29 11-42-13.png (305.8 KiB) Viewed 3694 times
Screenshot from 2016-12-29 11-34-16.png
Screenshot from 2016-12-29 11-34-16.png (268.31 KiB) Viewed 3694 times
Screenshot from 2016-12-29 11-33-45.png
Screenshot from 2016-12-29 11-33-45.png (366 KiB) Viewed 3694 times
Screenshot from 2016-12-29 10-31-21.png
Screenshot from 2016-12-29 10-31-21.png (272.63 KiB) Viewed 3694 times
Post Reply