Arch Window - Glass Panel Area etc in Python Script?

A forum dedicated to the Draft, Arch and BIM workbenches development.
paullee
Posts: 2624
Joined: Wed May 04, 2016 3:58 pm

Arch Window - Glass Panel Area etc in Python Script?

Post by paullee » Fri Nov 17, 2017 12:50 pm

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 1552 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: 717
Joined: Sun Jul 12, 2015 8:17 am
Contact:

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

Post by regis » 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.
paullee
Posts: 2624
Joined: Wed May 04, 2016 3:58 pm

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

Post by paullee » Sat Nov 18, 2017 8:19 am

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: 717
Joined: Sun Jul 12, 2015 8:17 am
Contact:

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

Post by regis » Sat Nov 18, 2017 5:03 pm

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 1459 times
paullee
Posts: 2624
Joined: Wed May 04, 2016 3:58 pm

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

Post by paullee » Sat Nov 18, 2017 5:37 pm

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: 717
Joined: Sun Jul 12, 2015 8:17 am
Contact:

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

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

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

Post by paullee » Sat Nov 18, 2017 11:02 pm

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

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

Post by regis » Sun Nov 19, 2017 12:02 am

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 1426 times
paullee
Posts: 2624
Joined: Wed May 04, 2016 3:58 pm

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

Post by paullee » Sun Nov 19, 2017 12:35 am

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: 717
Joined: Sun Jul 12, 2015 8:17 am
Contact:

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

Post by regis » Sun Nov 19, 2017 12:55 am

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

Who is online

Users browsing this forum: No registered users and 1 guest