[Program om github]Need testers for a properties program.

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
dan-miel
Posts: 391
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

[Program om github]Need testers for a properties program.

Post by dan-miel »

This workbench allows a user to enter properties into the dialog form and update the properties in the drawing with the ‘UD DRW’ button.
To use this workbench: unzip the file and copy the FileProperties folder to the FreeCAD mod folder. The workbench should show when you restart FreeCAD.
The dialog box will show the properties you need for your drawings. To load the properties, have a FreeCAD file with a drawing in it. Press the icon with the red squares, this creates a properties object in your file.
Press the button on the top that says, “From Drawing” and close the form.
Reopen the form with the red icon. All of your properties from the drawing should be there. One problem I had is that properties with a Hyphen or Minus sign could not be added, they show with 4 a’s in place of the minus sign and will not work.
Add your values in the left-hand column.
Use the SaveClose button to save them. Use the “UD DRW” to copy the properties to the drawing.
To add the file name or date to the values you can click in the cell and click Add Date or Name.
The properties object is a gray icon in the tree. You can copy and paste it to another File to transfer all of your properties to that file. You can then open the properties program without the drawing being added.
Dan
.
Attachments
File properties.JPG
File properties.JPG (28.77 KiB) Viewed 753 times
Last edited by dan-miel on Mon Nov 28, 2022 9:54 pm, edited 2 times in total.
ChemicalCoal
Posts: 24
Joined: Sun May 09, 2021 3:38 am

Re: Need testers for a properties program.

Post by ChemicalCoal »

This is neat, a few things I noticed:

Code: Select all

OS: Arch Linux (sway)
Word size of FreeCAD: 64-bit
Version: 0.21.31109 (Git)
Build type: Unknown
Branch: master
Hash: c23ee7ad88433a0f00e84afae0a62fe738be0c09
Python 3.10.8, Qt 5.15.7, Coin 4.0.1, Vtk 9.1.0, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods: 
  * dodo
Looks like theres an error when clicking Add Name in an unsaved part:

Code: Select all

Traceback (most recent call last):
File "Mod/FileProperties/./CD_FileProperties.py", line 187, in <lambda>
self.btnAddFileName.clicked.connect(lambda:self.addFilename())
File "Mod/FileProperties/./CD_FileProperties.py", line 204, in addFilename
name = filepath[1]
IndexError: list index out of range

After pressing the from drawing button, it would be nice if the file properties updated to show the new properties without needing close and reopen.

The "aaaa" fix doesn't work when saving with a property with special characters:

Code: Select all

Traceback (most recent call last):
    File "Mod/FileProperties/./CD_FileProperties.py", line 138, in <lambda>
      self.btnSaveClose.clicked.connect(lambda:self.SaveClose())
    File "Mod/FileProperties/./CD_FileProperties.py", line 233, in SaveClose
      self.saveProperties()
    File "Mod/FileProperties/./CD_FileProperties.py", line 272, in saveProperties
      propobj.addProperty("App::PropertyString",prop,"Prop")
  NameError: {'sclassname': 'N4Base9NameErrorE', 'sErrMsg': "Invalid property name 'a-b'", 'sfile': 'src/App/DynamicProperty.cpp', 'iline': 176, 'sfunction': 'App::Property* App::DynamicProperty::addDynamicProperty(App::PropertyContainer&, const char*, const char*, const char*, const char*, short int, bool, bool)', 'swhat': "Invalid property name 'a-b'", 'btranslatable': False, 'breported': False}
For what ever reason properties with names "a" and "ab" don't show up in the File Properties window.

I didn't run into any other troubles.

Side note:
The plan for this is to have an easily parsable properties for a PDM? Is there an already selected PDM this is trying to integrate with?
dan-miel
Posts: 391
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: Need testers for a properties program.

Post by dan-miel »

Thanks for the input:
ChemicalCoal wrote: Sun Nov 27, 2022 5:47 am Looks like theres an error when clicking Add Name in an unsaved part:
Fixed the name.
ChemicalCoal wrote: Sun Nov 27, 2022 5:47 am After pressing the from drawing button, it would be nice if the file properties updated to show the new properties without needing close and reopen.
I fixed that plus the dialog did not import the values of the properties, I fixed both.
ChemicalCoal wrote: Sun Nov 27, 2022 5:47 am The "aaaa" fix doesn't work when saving with a property with special characters:
I was just using the aaaa to keep the program from crashing. I believe I found a workaround so values and properties are working.
ChemicalCoal wrote: Sun Nov 27, 2022 5:47 am For whatever reason properties with names "a" and "ab" don't show up in the File Properties window.
I couldn't find this error. If I knew of a template, I could check it out.
ChemicalCoal wrote: Sun Nov 27, 2022 5:47 am Side note:
The plan for this is to have an easily parsable properties for a PDM? Is there an already selected PDM this is trying to integrate with?
Side note:
This is a spinoff of PDM project because file properties need to be easily accessible and the same company wide. Properties need to match between files, drawings, PDM and any other database. I ran into too many problems with PDM but I hope some people will find this useful.
Dan
Attachments
FileProperties Ver5.zip
(109.86 KiB) Downloaded 13 times
dan-miel
Posts: 391
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: [Program om github]Need testers for a properties program.

Post by dan-miel »

This program save properties and writes to TechDraw drawing properties.
It is now on github https://github.com/DanMiel/FileProperties.

Download a zip file, unzip and copy FileProperties folder to Mod folder. More directions on github.
Dan
Post Reply