View Issue Details
|0001703: Spreadsheet PropertyController
|It is now possible to modify values of sketch datum constraints directly from properties dialogue:
Therefore PropertyController should allow the user to modify it from Spreadsheet object but i tested this and it seems not to work.
|Steps To Reproduce
|1.) Create sketch with datum constraint in it.
2.) Try to modify created datum constraint exposed to sketch properties with Spreadsheet PropertyController.
|It looks like the feature itself is still under active development and things could change in the near future:
If this will be fixed i am guessing Spreadsheet PropertyController could be simplified and the part dealing with sketch directly could be completely removed:
1.) Target Type could be completely removed from dialogue.
2.) Target Property could be renamed to Property Value.
If i remember correctly potential "infinite loop" when dealing with sketch directly using mentioned Spreadsheet PropertyController would not exist any more (i am guessing the new code that exposes datum constraints as sketch properties does not have this behaviour but if it does that is stuff for another in future bug report).
|No tags attached.
"2.) Target Property could be renamed to Property Value."
Small correction. Actually i was after proposing the term Property Name or simply Property and somehow wrote Property Value instead (Property Value is a different thing and the Property Value itself is written to spreadsheet cell).
|Sorry for my ignorance but I have never worked with the spreadsheet module. How is the supposed workflow to allow to alter values from within a sheet?
1.) Create sketch with datum constraint(s) in it.
2.) Crate feature like Pad (property Length).
3.) Add new Spreadsheet object.
4.) Add Spreadsheet PropertyController to the spreadsheet.
Added Spreadsheet PropertyController when set up correctly (Property view -> Data tab) allows the user to alter datum constraint (sketch) or feature property (for example pad Length) directly from spreadsheet cell (after the value is set in the cell and Compute button is pressed). Note that user needs to add and set up new PropertyController for each datum constraint or feature property it wants to control.
Because Sketch now exposes datum constraints as properties i do believe it makes sense to use that instead of directly tinkering with sketch but currently this does not work. Using property Length of a Pad does work but using individual exposed datum constraint as property of sketch does not seem to work and this what this bug report is about. To make that work.
I made simple example and i attached infographic of how one could build two simple objects and control them from spreadsheet. I added few simple relations between the two objects.
Ok, thanks for the description.
> Because Sketch now exposes datum constraints as properties i do believe it
that's wrong. Datum constraints are no properties they are just strings which are used inside the property editor or the constraints widget in a special way.
I see although datum constraints are listed in individual sketch property editor they are not actually "real properties".
Well i guess that explains why Spreadsheet PropertyController can't control them in the first place and i guess therefore stuff like inputting named datum constraint from individual sketch property editor to PropertyController (Target Property) is not possible this way ATM.
Well at least we still have working solution available in FreeCAD by inputting datum constrains numbers and i guess this "bug report" can be closed as "won't fix".
|Btw, if you set Target Type to Constraint and Target Property to 0 instead of 1 it works. This is because you count from 0 and not 1.
Yes the counting of sketch constraints starts from 0 and having larger set of constraints usually (from end user point of view) always involve some trial and error procedure to get the problem solved. When Yorik made this feature available it took me quite a while to figure out the datum constraint part. I got property part figured out quickly but for the sketch datum constraints part that was a bit harder. I don't know how other users deal with this.
That is why i thought the benefits of now having datum constraints exposed as sketch properties could be used for Spreadsheet PropertyController. From end user point of view that would simplify things and the Spreadsheet PropertyController dialogue could be simplified to only take Properties of selected object. Drop down menu of all object available properties could be provided that would further simplify things for end users.
But in the end it turned out i was wrong in assumptions and sketch doesn't really expose datum constraints as "real properties" and therefore not much else could be said about this ATM.
But on the bright side the feature is still there and it does the job and i am grateful for that.
I just checked and i don't know if it belongs in this ticket report but i guess no harm down if something gets mentioned twice:
Ulrich probably isn't FreeCAD novice user but has found himself in the situation where sketch datum constraint part set-up was not the task to figure out easily.
Original implementation did work "in sync" but Yorik changed that when he consulted other devs:
Something like "refresh" button would probably be cool to fetch existing data not only to be able to set it. Or ideally in the future to figure out the correct method for the spreadsheet and the solver to automatically stay "in sync" again and not to cause any potential issues to solver.
In my opinion spreadsheet is the correct place to do this but in the end i will use whatever tool will do the job and who knows maybe few methods will be available in the future to do the same task. And in my opinion current implementation does the job quite well but i do imagine it is a bit hard to grasp for first time users.
"Btw, if you set Target Type to Constraint and Target Property to 0 instead of 1 it works. This is because you count from 0 and not 1."
And just to clarify this you are probably referring to Target Property set to 1 in infographic example for circle in Sketch Shaft?
The reason Target Property is not set to 0 is because there is coincident constraint at position 0 and therefore Shaft radius datum constraint is set/located at position 1. If i would add Shaft radius datum constraint before i added coincident constraint then i would need to use 0 instead indeed.
Actually there is a pretty easy way to support named properties in the spreadsheet. Two things therefore need to be extended:
1. The sketcher's setDatum() method must be changed to also accept a string (for the name)
2. Spreadsheet.py needs to be extended to also support "TargetProperty" to be a string and use the above setDatum
These are two rather small changes and whether named constraints are properties or not is totally irrelevant in this context.
|Note Added: 0004982
|Note Added: 0004986
|File Added: Infographic.png
|Note Added: 0004987
|Note Added: 0004988
|Bug => Feature
|Note Added: 0004989
|Note Edited: 0004989
|Note Added: 0004990
|Note Added: 0004991
|Note Added: 0004992
|Note Added: 0004993
|Note Added: 0004994
|=> FreeCAD Master master 3c8a00df
|new => closed
|open => fixed