Library and Structure WB

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
fdomateu
Posts: 26
Joined: Thu May 17, 2018 7:14 am

Re: Library and Structure WB

Post by fdomateu »

Many thanks for your code microelly2, I will check when I have time. I have tested and I have ssen that this code makes a "shape clone" object with the adition of some propertie.
fdomateu
Posts: 26
Joined: Thu May 17, 2018 7:14 am

Re: Library and Structure WB

Post by fdomateu »

I have been searching on internet about the problem of dynamic properties on containers like Body and Part. I have seen that some time ago Yorik had also the same question at a different discussion. From that discussion I have found a new external worbench for FreeCAD 0.17 where this container is under development, bellow I have atached the link.

https://github.com/DeepSOIC/Part-o-magic
akredd
Posts: 71
Joined: Wed Mar 19, 2014 8:31 pm
Location: D-02733 Cunewalde

Re: Library and Structure WB

Post by akredd »

Hi Fernando
safri_jefro wrote: Mon Jul 30, 2018 6:01 pm Doing god's work fdomateu ! Keep it up! It is just what we mechanical engineers need! Looking forward to see it implemented. Step by step FreeCAD will become on par with most modern software!
+1

In the german forum and now here in the open discussion forum is the idea to make those WB etc. more configurable by users: https://forum.freecadweb.org/viewtopic.php?f=8&t=30092

In your ISO_7092-test.py the data from standard are in the code. Because it is a "test" I suppose that later this will be changed. As I offered in the other forum-thread I can have a look at the standards as long as I work as mechanical engineer.

Some remarks in addition. I think it will be good, that you will distinguish between geometry and properties. Here I think at e.g. screws of the same geometry, but with different qualities. Standard parts mostly will be created once and than the user will find them in a special folder. So the name of the file will bee important in the future. Most of the norms have a denomination from which this filename can be derived.
Do You intend to include not only parts but also geometry like undercuts, holes etc.? Than You should have a look at the hole-feature https://github.com/FreeCAD/FreeCAD/blob ... andards.py. And it would fit your plan in LibraryParts.jpeg beneath the Standard-parts-class. ;)

I'm curious to test it.

Andreas
fdomateu
Posts: 26
Joined: Thu May 17, 2018 7:14 am

Re: Library and Structure WB

Post by fdomateu »

Hi akredd,

I have cheked your propose Standards.py. I am still making tests and thinking how to build the WB proposed by me that you are showing interest. I have to say that I think that I have a different perspective than you, I will try to explain you.

At your file Standards.py you write all the code necessary for the part, at this case holes. And there is no pre-defined way to introduce all this information. At the begining you wirite many dictionaries with the information and at the end of the file you write the code to generate all the things.

My propose is to define in the workench pre-defined objects like shape, screw, etc, with many different functions and attributes that the operator should define in a fixed way. Every standard part file will have a function to define the norm, the old norm, the geometry parameters, the description at many different languajes, etc. The object will also have a fucntion that must be writed by the user, the geometry script. From my point of view, this is the best and cleanest way to have a library WB.

I heve like your idea to have a basic geometry fucntion and a refined geometry fucntion at the object. Can you explain me the advantgage to have separeated the dictionaries with the information and the code? I am very interesting on your opinion. As I have mentioned, I am still thinking on the workbench and making small tests, you can change my opinion to create the WB in a better way.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Library and Structure WB

Post by Kunda1 »

Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
akredd
Posts: 71
Joined: Wed Mar 19, 2014 8:31 pm
Location: D-02733 Cunewalde

Re: Library and Structure WB

Post by akredd »

Hi fdomateu,
sorry for answering late - I had hollydays :D and now I'm not sitting at my own PC. I will answer You in the middle of October.
fdomateu
Posts: 26
Joined: Thu May 17, 2018 7:14 am

Re: Library and Structure WB

Post by fdomateu »

Hi akredd,

Don't worry, I also have had holidays and I have not had so much time the last weeks. When you have time, we can continue the discussions.
fdomateu
Posts: 26
Joined: Thu May 17, 2018 7:14 am

Re: Library and Structure WB

Post by fdomateu »

Hi everybody,

I am working on the definition of the standard part and after some time reading code and documentation I have some questions that I would like that someone helps me. Bellow you will find how I am actually planing the standard part object.

The questions are the following:
  • Ny intetion is to make a object with some static properties as strings and two properties that can be chaned at any time, the dimensions and the material. Is correct to use a dynamic propertye that is defining the metric, the profile section? The user should be able to change this string and FreeCAD will change the geometrical dimensions according the library data automatically.
  • I suppose that the only way to include the Origin at the standard part is using a propertyLink and link to an APP:Origen Object. Is this correct?
  • Which solution is better for the geometry of the part, using a propertyLink and use a App::pythonFeature or use the App::propertyGeometry? At the case that is bettr to use the propertyGeometry, s there any example or can someone helps me to learn how to use?
Many thanks
Attachments
StandardPart.PNG
StandardPart.PNG (35.89 KiB) Viewed 1593 times
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Library and Structure WB

Post by ulrich1a »

fdomateu wrote: Fri Oct 19, 2018 10:22 pm My intention is to make a object with some static properties as strings and two properties that can be changed at any time, the dimensions and the material.
You may need to consider, that in real life more things are interesting:
    A material alone may not be enough to describe the properties of a part. For screws you need also to define the surface like coatings and surface treatment like polishing.
    A lot of companies have part-numbers that are needed to create a bill of material.
    Certificates may be required for a material in special cases.

    A given part library may provide the geometry and underlaying standards. Users may want to define subsets from the library parts but with further specifications. This means, that the user definable specifications should have more fields. Some of them should be predefined like part number.

    It may be good, if the data structure allow a future use of a user defined database, where part-numbers can be selected and the further definitions are provided from this database.

    A different but related approach to library parts user defined family parts. These consist of a spreadsheet, that contains the geometric data for the family and a geometric model that gets its data from the spreadsheet and an object, that allows to select which data are used from the spreadsheet. Such a construct allows users to generate any kind of standardized parts but it needs support from a workbench for this special objects.
    I once made a proof of concept here: https://forum.freecadweb.org/viewtopic.php?f=10&t=18520

    Ulrich
    fdomateu
    Posts: 26
    Joined: Thu May 17, 2018 7:14 am

    Re: Library and Structure WB

    Post by fdomateu »

    Hi ulrich1a,

    I agree with you but FreeCAD does not allow to define properties dynamically at the Part and Body objects, the user can only change the values of the pre-defined properties. Do someone know if there is any plan to change this?

    At the construction and engineering field, nowadays the information is introduced at the 3D model and not on the drawings, this is the main idea from the BIM philosophy. I normally use Inventor from Autodesk and I am used to work with the following tables:
    • The parameters table: Table with all dimensions from the "body" features. At Autodesk each parameter can be changed editing the operation (PartDesign Feature) or changing the value at the parameters table. The information from this table is normaly used to create geometrical formulas like <length> x <width> x <high>. This formula is later on displayed at the part list from the drawing.
    • Properties table: Table where the designer can define the formulas that later on should be displayed on drawings and every information that can be defined as string (manufacturer, web manufacturar link, assembly group, machine, description in many languajes, manufacturer reference code, etc. ).
    As I have mentioned, the command addProperty or AddDianmicPoperty are not working for Part and Body on FreeCAD, or I do not know how to use them, can someone explain me what is th idea to define all this issues at FreeCAD? Actually I create Parts as a group of a SpreedSheet and a Body. At the SpreedSheet I denie the parameters and at the PartDesign feature I define each dimension as a python expression. This rudimentary solution is working but I do not consider a nice solition because the SpreedSheet is inside the Part container but it is a different object.
    Attachments
    part_parameters.PNG
    part_parameters.PNG (64.45 KiB) Viewed 1551 times
    Post Reply