A2Plus PARTLIST doesn't read parameters from PARTINFO(s) (bug or not?)

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
totalcad
Posts: 70
Joined: Sun Oct 20, 2019 9:09 pm

A2Plus PARTLIST doesn't read parameters from PARTINFO(s) (bug or not?)

Post by totalcad »

Hello! First of all great thanks for making A2Plus to developers! I'm studing A2Plus and found it cool!

Is this a bug or just missing functionality, when the #PARTLIST# can't find the part's properties, if the internal parameters are used in the #PARTINFO# of each part? If A2Plus #PARTLIST# could read parameters from every #PARTINFO# without making the general spreadsheet in the main assembly, it could let us make a huge part's library for reusing in other assemblies. But in my case, if I write internal parameters of the part in the #PARTINFO# - the #PARTLIST# can't read a parameter from the part.
An additional video:https://yadi.sk/i/pcnt8Wq0Aui78A
Thanks!
Attachments
A2Plus PARTLIST links.png
A2Plus PARTLIST links.png (165.94 KiB) Viewed 3360 times
Last edited by totalcad on Wed Oct 23, 2019 7:40 pm, edited 2 times in total.
PhilCera
Posts: 12
Joined: Wed Jun 12, 2019 10:41 am
Location: Belgique

Re: A2Plus PARTLIST parameter's linking (bug or not?)

Post by PhilCera »

Hello,

You're right, there's a small bug in the file ".FreeCAD/Mod/A2Plus/a2p_simpleXMLreader.py" : the line 130 must be changed in :

elif not spreadSheetCellsFound and line.startswith(b'<Property name="cells" type="Spreadsheet::PropertySheet"'):

With this changed, PartList can read spreadsheets created with PartInfo, for me. But I didn't used references to variables in my spreadsheets!

With hope it help...

Philippe
User avatar
totalcad
Posts: 70
Joined: Sun Oct 20, 2019 9:09 pm

Re: A2Plus PARTLIST parameter's linking (bug or not?)

Post by totalcad »

Big thanks for answer, PhilCera!
I'm not a programmer, unfortunately//... I've made some corrections with the file, you've advised (with monkey understanding). Have no result.
But if this is not so big programming job, it's fine. May be I could make a bug report in some bug tracker (if it exist).
Just want to say: PARTLIST conception, like I've mentioned could have a great success. We could make a part's library with specialized parameters (length of steel rental, sheet metal area, concrete volume etc.) and make some assemblies.
For now I make a part and make PARTINFO with simple digits for it : when I change a length of a part - I manually correct a PARTINFO's digits every time. It takes a time and also it makes a risk to correct a length but to forget the correction in the PARTINFO. So this operation could be automatic better.
Attachments
A2Plus_PARTLIST_error.png
A2Plus_PARTLIST_error.png (293.05 KiB) Viewed 3280 times
Turro75
Posts: 179
Joined: Mon Aug 15, 2016 10:23 pm

Re: A2Plus PARTLIST parameter's linking (bug or not?)

Post by Turro75 »

Hi totalcad,

at the moment the imported part are not parametric as they are a "screnshot" of current original part.

We have to involve the Father of a2plus, @kbwbe I have a proposal for making more flexible the importing process:

let's say the user create a part which should keep some parametric parameters i.e. the lenght for a pipe.
The user could create a spreadsheet called Config where all parameters are store and all dimensions are linked to those cells, or in PARTINFO spreadsheet the user can add cells with name such as as Config_XXXXX.
During first import step, all cells that match the rule above are added to a spreadsheet in the part tree within assembly, the user can then modify the parametric values within assembly for each part even the duplicated ones.
During refresh, the original part can be copied to a temp file, recalculated by taking values present in the part tree in the assembly (which are now customized) then imported as usual, once successfully updated the temp part is discarded and the original is left unchanged avoiding conflicts with other assemblies. How about this? it could be an option?
User avatar
totalcad
Posts: 70
Joined: Sun Oct 20, 2019 9:09 pm

Re: A2Plus PARTLIST parameter's linking (bug or not?)

Post by totalcad »

Hello, Turro75!
at the moment the imported part are not parametric as they are a "screnshot" of current original part.
- Thanks for clarification! My programming knowledge at zero level, so I can't understand much. I look to the question from the practical side. If #PARTINFO# could just see correct values from #PARTINFO#(s) - that's super for me at this time...
I tried also to write some parameters to #PARTINFO# straight from the part element using "Pad.Length"-formula bypassing of spreadsheet using (look the screenshot) - no result. My thought is: may be there's some logical function in a spreadsheet, which lets to convert a formula to digit, that #PARTLIST# could understand...?
During refresh, the original part can be copied to a temp file, recalculated by taking values present in the part tree in the assembly (which are now customized) then imported as usual, once successfully updated the temp part is discarded and the original is left unchanged avoiding conflicts with other assemblies. How about this? it could be an option?
- Sorry for misunderstanding, If I get things right you mean the possibility to correct the part's values inside the assembly bypassing the corrections of the external original imported part? I'm not sure this could be a comfortable idea. My position is that the main assembly could make "screnshots"(as you've mentioned) only from original files, that are "linked" (sorry for my terminology, if it's not correct) to the assembly. Otherwise, if you will want to reuse some parts from your assemble - you'll need some export function from the assembly, because the original files can have not the same values as in the assembly. And so you can just copy library's parts to your project folder, import to the assemblies, modify them and A2Plus will join them as they are.
Attachments
Param_value_A2P_error.png
Param_value_A2P_error.png (198.79 KiB) Viewed 3188 times
User avatar
totalcad
Posts: 70
Joined: Sun Oct 20, 2019 9:09 pm

Re: A2Plus PARTLIST parameter's linking (bug or not?)

Post by totalcad »

@PhilCera, could you check my corrections in the "a2p_simpleXMLreader.py" file (a screenshot from my previous answer)? Is it right, as you've advised?
I want to believe this is some sort of variables interpretation (or something similar). If I succeed to solve the problem only with some corrections in ".py"-files - this could be super!
Last edited by totalcad on Wed Oct 23, 2019 7:30 pm, edited 3 times in total.
herbk
Veteran
Posts: 2657
Joined: Mon Nov 03, 2014 3:45 pm
Location: Windsbach, Bavarya (Germany)

Re: A2Plus PARTLIST parameter's linking (bug or not?)

Post by herbk »

Hi Guys,
in my mind you are going wrong with your ideas what A2+ and it's partlist is / should doing.
It's not the goal to change parameters of an part inside A2+, - not manual and not with the Partlist. If you want to change parameters of a importet part, open the parts file, change the parameters and save the file. After refreshing (recalculating) the assembly the change is made at the assemly to.

The Partslist isn't a tool to resize importet parts, it's a Bill of Material which shows all to the Assembly added parts.
Gruß Herbert
User avatar
totalcad
Posts: 70
Joined: Sun Oct 20, 2019 9:09 pm

Re: A2Plus PARTLIST parameter's linking (bug or not?)

Post by totalcad »

Hi, herbk! Thanks for reply!
The Partslist isn't a tool to resize importet parts,
- My question is not about the parameters corrections through the #PARTLIST# - I was not going to do that.

it's a Bill of Material which shows all to the Assembly added parts.
- Yes, this is exactly what I'm looking for! In my case - it's not working (I've created the topic specially for it).

May be the name of the topic was not so clear, so I've renamed it to "A2Plus PARTLIST doesn't read parameter's from PARTINFO(s) (bug or not?)"
kbwbe
Veteran
Posts: 1052
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: A2Plus PARTLIST parameter's linking (bug or not?)

Post by kbwbe »

totalcad wrote: Wed Oct 23, 2019 6:56 pm May be the name of the topic was not so clear, so I've renamed it to "A2Plus PARTLIST doesn't read parameter's from PARTINFO(s) (bug or not?)"
Hi guy's,

reading parameters from #partinfo# spreadsheets was never intended within A2plus. The intension was to code a simple algorithm which is "crawling" over all subassemblies and collecting all the parts of an assembly for generating a partslist. Without need to open every file within FreeCAD. Therefore the "document.xml" (which is a part of each .FCStd file) is evaluated directly and the necessary information is extracted from the #partinfo#'s. During these steps there is no expression evaluation possible. (At least with simple XML analysis)

A2plus is reading static text entries within each #partinfo# spreadsheet. You cannot define parameters here. Every entry has to be simple text. Sorry for no better news.
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.56, installable via FreeCAD's addon manager
Tutorial: gripper assembly https://www.youtube.com/watch?v=QMxcQ5tssWk
Documentation: https://www.freecadweb.org/wiki/A2plus_Workbench
herbk
Veteran
Posts: 2657
Joined: Mon Nov 03, 2014 3:45 pm
Location: Windsbach, Bavarya (Germany)

Re: A2Plus PARTLIST parameter's linking (bug or not?)

Post by herbk »

Hi,
totalcad wrote: Wed Oct 23, 2019 6:56 pm
it's a Bill of Material which shows all to the Assembly added parts.
- Yes, this is exactly what I'm looking for! In my case - it's not working (I've created the topic specially for it).
Oh, yes you are right (and i missunderstood the posts, sorry). I did not use the Partslist for some time and think to remember that it worked, but a quick test shows that nothing written to Partsinfo is shown at the partslist.

I`m not sure how often @kbwbe looks to the bugreport, better we give him a ping here... ;)
kbwbe wrote: Tue May 21, 2019 3:56 pm ping
OS: openSUSE Leap 15.1 (KDE//usr/share/xsessions/plasma5)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18589 (Git) AppImage
Build type: Release
Branch: master
Hash: 3500451a040989d00693eab85b2a7c13ce4dad67
Python version: 3.7.3
Qt version: 5.12.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
Gruß Herbert
Post Reply