rebar2
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: rebar2
Thank you @Bernd for the welcome!
Also a big thank to you @Suraj for developing the BOM feature. It is a very important part of the whole thing.
I've retested BOM-rebar for the two example files provided by Bernd: example_04_vat.ifc and example_03_crane_foundation.ifc.
Now BOM-tables are created for rebar2 objects - WOW!
As shown in the following picture there remains some minor issues.
In the model there is a rebar-shape with diameter 18mm, in the BOM-List, maybe due to rounding problems, it is shown in an unespected mode. Another improvement could be to limit the digits shown for the columns depending on the units choosen. For bar "Diameters in mm" and for "Length in cm/piece" the digits maybe are unnecessary. This has to be discussed.
Thank you for your work
balrobs
Also a big thank to you @Suraj for developing the BOM feature. It is a very important part of the whole thing.
I've retested BOM-rebar for the two example files provided by Bernd: example_04_vat.ifc and example_03_crane_foundation.ifc.
Now BOM-tables are created for rebar2 objects - WOW!
As shown in the following picture there remains some minor issues.
In the model there is a rebar-shape with diameter 18mm, in the BOM-List, maybe due to rounding problems, it is shown in an unespected mode. Another improvement could be to limit the digits shown for the columns depending on the units choosen. For bar "Diameters in mm" and for "Length in cm/piece" the digits maybe are unnecessary. This has to be discussed.
Thank you for your work
balrobs
- Suraj Dadral
- Posts: 307
- Joined: Fri Sep 07, 2018 5:32 pm
- Contact:
Re: rebar2
Looks cool.bernd wrote: ↑Wed Apr 29, 2020 8:10 pm https://github.com/berndhahnebach/rebar ... 5684e54fc2 adds a new object linear reinforcement. It can be used to distribute any base rebar object along a line. Amount, Distance, Spacing OffsetStart and OffsetEnd, all Attributes from standard FreeCAD rebar can be given.
Code: Select all
import FreeCAD, Draft, archadd from FreeCAD import Vector as vec wire1 = Draft.makeWire([vec(0, 0, 0), vec(3000, 0, 0)]) baserebar4 = archadd.BaseRebar(wire1, diameter=30, mark=4, name="BaseRebar_4") FreeCAD.ActiveDocument.recompute() rebdistribution6 = archadd.ReinforcementLinear(baserebar4, amount=20, spacing=100, name="Reinforcement_6") FreeCAD.ActiveDocument.recompute()
With code provided above, the linear rebar2 is created successfully. But, when I reopened same file, it gives following error and reinforcement object moved outside of BaseRebar object.
Code: Select all
Traceback (most recent call last):
File "/home/blank/.FreeCAD/Mod/rebar2/archobjects/base_rebar.py", line 156, in onDocumentRestored
super().onDocumentRestored(self, obj)
<class 'TypeError'>: onDocumentRestored() takes 2 positional arguments but 3 were given
Traceback (most recent call last):
File "/home/blank/.FreeCAD/Mod/rebar2/archobjects/reinforcement_generic.py", line 178, in onDocumentRestored
super().onDocumentRestored(self, obj)
<class 'TypeError'>: onDocumentRestored() takes 2 positional arguments but 3 were given
Traceback (most recent call last):
File "/home/blank/.FreeCAD/Mod/rebar2/archobjects/base_rebar.py", line 156, in onDocumentRestored
super().onDocumentRestored(self, obj)
<class 'TypeError'>: onDocumentRestored() takes 2 positional arguments but 3 were given
Traceback (most recent call last):
File "/home/blank/.FreeCAD/Mod/rebar2/archobjects/reinforcement_generic.py", line 178, in onDocumentRestored
super().onDocumentRestored(self, obj)
<class 'TypeError'>: onDocumentRestored() takes 2 positional arguments but 3 were given
Related FreeCAD file:
My FreeCAD info:
OS: Kali GNU/Linux Rolling (GNOME/gnome)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20655 (Git) AppImage
Build type: Release
Branch: master
Hash: e8e67e8c5ebbc9f9ed9ea67aba5b891969595ece
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/India (en_IN)
Thanks,
Re: rebar2
found the same here too this morning. Need to tackle this down.
bernd
bernd
Re: rebar2
https://github.com/berndhahnebach/rebar ... e1b62160a9Suraj Dadral wrote: ↑Thu Apr 30, 2020 10:25 am With code provided above, the linear rebar2 is created successfully. But, when I reopened same file, it gives following error and reinforcement object moved outside of BaseRebar object.
- Suraj Dadral
- Posts: 307
- Joined: Fri Sep 07, 2018 5:32 pm
- Contact:
Re: rebar2
Thanks @balrobs for reporting this issue.balrobs wrote: ↑Wed Apr 29, 2020 8:43 pm As shown in the following picture there remains some minor issues.
BOM_for_example_03_crane_foundation.png
In the model there is a rebar-shape with diameter 18mm, in the BOM-List, maybe due to rounding problems, it is shown in an unespected mode. Another improvement could be to limit the digits shown for the columns depending on the units choosen. For bar "Diameters in mm" and for "Length in cm/piece" the digits maybe are unnecessary. This has to be discussed.
It is fixed as per commit: https://github.com/SurajDadral/FreeCAD- ... 8daf342920
Solution: Use user preferred units from FreeCAD preferences. Related code to get precision:
Code: Select all
# Get user preferred unit precision
precision = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Units").GetInt("Decimals")
BOM outputs for example files provided by @bernd:
Thanks,
- Suraj Dadral
- Posts: 307
- Joined: Fri Sep 07, 2018 5:32 pm
- Contact:
Re: rebar2
Thanks @berndbernd wrote: ↑Thu Apr 30, 2020 11:50 amhttps://github.com/berndhahnebach/rebar ... e1b62160a9Suraj Dadral wrote: ↑Thu Apr 30, 2020 10:25 am With code provided above, the linear rebar2 is created successfully. But, when I reopened same file, it gives following error and reinforcement object moved outside of BaseRebar object.
Now, error is gone.
Thanks,
Re: rebar2
Hi @Bernd,
I could'nt resist to see what's happening when I copy a Reinforcement-object with the Draft copy-command.
I got an unexpected result. I expected to see a new Reinforcement-object under the same BaseRebar-object.
What I see is a new object outside with only Placement and Label properties.
Copying a Rebar-Object produces an object with only Placement and Label properties too.
What is your opinion in the regard, how should copying of these objects work?
Thanks
balrobs
I could'nt resist to see what's happening when I copy a Reinforcement-object with the Draft copy-command.
I got an unexpected result. I expected to see a new Reinforcement-object under the same BaseRebar-object.
What I see is a new object outside with only Placement and Label properties.
Copying a Rebar-Object produces an object with only Placement and Label properties too.
What is your opinion in the regard, how should copying of these objects work?
Thanks
balrobs
Re: rebar2
clone or copy ?
Re: rebar2
Hi @Suraj,
thank you for your commit. I tried it and think that the choise to use the "number of decimals" from the Preference-Dialog is a quite good solution ... especially when the RebarLengthUnit and the RebartotalLengthUnit chosen by the user correspond to the LenghtUnit of the Preference-dialog.
What do you think?
Thanks
balrobs
thank you for your commit. I tried it and think that the choise to use the "number of decimals" from the Preference-Dialog is a quite good solution ... especially when the RebarLengthUnit and the RebartotalLengthUnit chosen by the user correspond to the LenghtUnit of the Preference-dialog.
If not maybe a solution like in the picture below could be considered. IMO it could be very helpfull to add a "Save Preferences"-Button in order that all preferences can be loaded when the next BOM is created. We can also consider to make this inputs available in the Preference-Dialog of FreeCAD under the section Preferences\Arch\Defaults\RebarBOM (or something like that?). Maybe a user is expecting to find them their.
What do you think?
Thanks
balrobs