Property Links

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
User avatar
sliptonic
Posts: 1679
Joined: Tue Oct 25, 2011 10:46 pm

Property Links

Postby sliptonic » Thu Apr 07, 2016 2:57 pm

If I understand correctly, There are these property types for storing reference to objects.

propertylink
contains a single object

propertylinklist
contains a list of objects

PropertyLinkSub
contains a tuple of an object and a list of sub objects: (obj1, ['Edge1', 'Edge2'])

PropertyLinkSubList
contains either a list of alternating objects and subs [obj1, "Edge1", obj2, "Edge1", ...]
or a list of tuples of objects, subelement pairs. [(obj1, 'Edge1'), (obj2, 'Edge1')]

In Path operations, the user will possibly be selecting multiple subelements from multiple objects. Let's assume the user is profiling edges of multiple objects. In that case, I think I'm looking for something like
"PropertyLinkListSubList" where a list of (obj1, ['Edge1', 'Edge2']) is preserved. Something like [(obj1, ['Edge1', 'Edge2']), (obj2, ['Edge1', 'Edge2'])]

Am I correct that there's nothing like that now?

My first thought was to reprocess it into [(obj1, 'Edge1'), (obj1, 'Edge2'),(obj2, 'Edge1'), (obj2, 'Edge2')] and use PropertyLinkSubList but now I can't tell whether the user selected those edges separately intending each to be processed with a separate roll-on move or whether he wanted them joined into a wire and processed in one move without lifting the cutter.

Is there another way I can do this?
User avatar
DeepSOIC
Posts: 7474
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Property Links

Postby DeepSOIC » Thu Apr 07, 2016 6:14 pm

Subelement link is just a string, so you may cram a list of elements (separated with semicolon or whatever). This technique kind of smells, but should work. AFAIR in PartDesign it's also abused for storing references to construction lines in sketches to be used as axis of Revolution.

Alternative is to store a LinkList, and accompany it with a StringList property (which is user-editable by the way ;) )

There are numerous other hacks to suggest. But as far as I know, there is no such kind of property that will do what you want straight away.
User avatar
sliptonic
Posts: 1679
Joined: Tue Oct 25, 2011 10:46 pm

Re: Property Links

Postby sliptonic » Fri Apr 08, 2016 3:35 pm

DeepSOIC wrote:Subelement link is just a string, so you may cram a list of elements (separated with semicolon or whatever). This technique kind of smells, but should work. AFAIR in PartDesign it's also abused for storing references to construction lines in sketches to be used as axis of Revolution.

Alternative is to store a LinkList, and accompany it with a StringList property (which is user-editable by the way ;) )

There are numerous other hacks to suggest. But as far as I know, there is no such kind of property that will do what you want straight away.
Thanks. I'll try a couple of the smelly hacks :lol:

Is there a case to be made that there *should* be such a property link or is it too much of an esoteric need?