How to get Length of ArchRebar?

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
chakkree
Posts: 327
Joined: Tue Jun 30, 2015 12:58 am
Location: Bangkok Thailand

How to get Length of ArchRebar?

Post by chakkree »

ArchRebar object have not Length property.
by insert line of code to ArchRebar.py
I try to get the length from base wire, But I'm not sure, this way is suitable.


line 170+171 in ArchRebarMo.py

Code: Select all

        obj.addProperty("App::PropertyLength", "Length", "BOQ", "The custom Length of each rebar") # chakkree
        obj.addProperty("App::PropertyLength", "TotalLength", "BOQ", "The custom Length of all rebars") # chakkree
line 287 in ArchRebarMo.py

Code: Select all

        obj.Length = wire.Length   # chakkree
line 386 in ArchRebarMo.py

Code: Select all

obj.TotalLength = wire.Length*obj.Amount # chakkree
MoArchRebar.png
MoArchRebar.png (479.3 KiB) Viewed 2171 times
ArchRebarMo.py
(24.03 KiB) Downloaded 52 times
----------------------------
Rebar Addon: Commits on Aug 26, 2017(122 commits)
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12367 (Git)
Build type: Release
Branch: master
Hash: 3b479e00c25e4d3112bc0340b48f35e1e87cde99
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: English/UnitedStates (en_US)
User avatar
regis
Posts: 732
Joined: Sun Jul 12, 2015 8:17 am
Contact:

Re: How to get Length of ArchRebar?

Post by regis »

chakkree wrote: Wed Oct 11, 2017 5:56 am ArchRebar object have not Length property.
by insert line of code to ArchRebar.py
I try to get the length from base wire, But I'm not sure, this way is suitable.


line 170+171 in ArchRebarMo.py

Code: Select all

        obj.addProperty("App::PropertyLength", "Length", "BOQ", "The custom Length of each rebar") # chakkree
        obj.addProperty("App::PropertyLength", "TotalLength", "BOQ", "The custom Length of all rebars") # chakkree
line 287 in ArchRebarMo.py

Code: Select all

        obj.Length = wire.Length   # chakkree
line 386 in ArchRebarMo.py

Code: Select all

obj.TotalLength = wire.Length*obj.Amount # chakkree
MoArchRebar.png
ArchRebarMo.py

:D :D :D :D :D :D :D So i'm still in my early beginnings at learning code python, and i've noticed that you end your code with comment # chakreee :D :D :D :D I like that personality in your code. Although I can't yet make sense of all the stuff in your code yet, I can begin to recognise some variable definition, i.e 'name' = ("something_string_in_parenthesis"), i don't see a ":" so i don't think there is a function defined here. well i don't know, whatever i'm still learning this stuff. It's soo cool
User avatar
chakkree
Posts: 327
Joined: Tue Jun 30, 2015 12:58 am
Location: Bangkok Thailand

Re: How to get Length of ArchRebar?

Post by chakkree »

regis wrote: Thu Oct 12, 2017 3:48 am
:D :D :D :D :D :D :D So i'm still in my early beginnings at learning code python, and i've noticed that you end your code with comment # chakreee :D :D :D :D I like that personality in your code. Although I can't yet make sense of all the stuff in your code yet, I can begin to recognise some variable definition, i.e 'name' = ("something_string_in_parenthesis"), i don't see a ":" so i don't think there is a function defined here. well i don't know, whatever i'm still learning this stuff. It's soo cool
At end line of code! it's easy to find what I insert to code for test concept.
Some case I can't remember what I do. :lol: :lol:
User avatar
chakkree
Posts: 327
Joined: Tue Jun 30, 2015 12:58 am
Location: Bangkok Thailand

Re: How to get Length of ArchRebar?

Post by chakkree »

Add "BOQ" properties to ArchRebar for quality takeoff.
run 'TakeOffRebar.py' to create 'BOQ' sheet.

MoArchRebar2.png
MoArchRebar2.png (265.8 KiB) Viewed 2068 times
TakeOffRebar.png
TakeOffRebar.png (182.77 KiB) Viewed 2068 times
Test01.FCStd
(51.36 KiB) Downloaded 41 times
ArchRebarMo2.py
(24.36 KiB) Downloaded 59 times
TakeOffRebar.py
(1.52 KiB) Downloaded 60 times
User avatar
chakkree
Posts: 327
Joined: Tue Jun 30, 2015 12:58 am
Location: Bangkok Thailand

Re: How to get Length of ArchRebar?

Post by chakkree »

Try new method, Not necessary to modified ArchRebar.
Assign material to rebar and run the script for take-off rebar.

RebarWithMaterial.png
RebarWithMaterial.png (556.62 KiB) Viewed 1985 times
BOQ2.png
BOQ2.png (355.71 KiB) Viewed 1985 times
TestRebarWithMaterial.FCStd
(69.95 KiB) Downloaded 45 times
TakeOffRebar2.py
(1.64 KiB) Downloaded 64 times
thschrader
Veteran
Posts: 3157
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: How to get Length of ArchRebar?

Post by thschrader »

cool... :)
materialList.JPG
materialList.JPG (46.02 KiB) Viewed 1941 times
UshapeRebar.JPG
UshapeRebar.JPG (19.33 KiB) Viewed 1941 times
User avatar
yorik
Founder
Posts: 13664
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: How to get Length of ArchRebar?

Post by yorik »

I would really like to have these new properties added by default to Rebars chakkree! Don't you want to do a pul request? ;)
One modification I would do is, instead of setting the obj.Length/TotalLength properties where you did it, do it at the end of the execute() function. It's best to change object properties only inside the execute function, because otherwise they could trigger execute() again, which results in endless loops..
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: How to get Length of ArchRebar?

Post by paullee »

The script in TakeOffRebar.py is really helpful to learn how to read information in the model and put it in a spreadsheet!

Maybe there is more than examples done by others also?


The Arch Schedule I read some time ago I remember had limited information that I really had not found actual use case about it at that moment - maybe complimentary to a spreadsheet?
User avatar
chakkree
Posts: 327
Joined: Tue Jun 30, 2015 12:58 am
Location: Bangkok Thailand

Re: How to get Length of ArchRebar?

Post by chakkree »

yorik wrote: Mon Oct 23, 2017 7:43 pm I would really like to have these new properties added by default to Rebars chakkree! Don't you want to do a pul request? ;)
One modification I would do is, instead of setting the obj.Length/TotalLength properties where you did it, do it at the end of the execute() function. It's best to change object properties only inside the execute function, because otherwise they could trigger execute() again, which results in endless loops..
About pull request, I'm new with GitHub. I don't know about pull request process, but I will learn about this.
And I'm not sure about new properties (BOQ section). I'm try to takeoff rebar from entire structure of a small house for check the bill of material for real use.
User avatar
chakkree
Posts: 327
Joined: Tue Jun 30, 2015 12:58 am
Location: Bangkok Thailand

Re: How to get Length of ArchRebar?

Post by chakkree »

paullee wrote: Tue Oct 24, 2017 6:05 pm The script in TakeOffRebar.py is really helpful to learn how to read information in the model and put it in a spreadsheet!

Maybe there is more than examples done by others also?


The Arch Schedule I read some time ago I remember had limited information that I really had not found actual use case about it at that moment - maybe complimentary to a spreadsheet?
@paullee, Now, I have only "TakeOffRebar2.py" script. Next stage, I'm trying to take-off formwork's area and concrete's volume. But it's still under finding the method.
Post Reply