Named Objects and their properties?
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
-
- Posts: 225
- Joined: Fri Apr 26, 2019 3:14 pm
Named Objects and their properties?
Hello,
While using Part Design w/ Sktecher I was wondering how to access any properties of used primitives - e.g. the length of an vertext to use it as input into an expression in any subsequent sketches.
I know that i may access (and name) constraints - but sometimes e.g. a length of a certain vertex results due to other constraints. Adding another constraint to e.g. access its lentgh leads to an overdetermined sketch.
So - helpful would be a possibility to access "named/labeld" Properties - or - having the properties of "passive constraints" - well - rather ... results in any wa accesible.
This might also facilitate the use of "external geometry" explicit ( in expressions ).
Regards,
Stefan
While using Part Design w/ Sktecher I was wondering how to access any properties of used primitives - e.g. the length of an vertext to use it as input into an expression in any subsequent sketches.
I know that i may access (and name) constraints - but sometimes e.g. a length of a certain vertex results due to other constraints. Adding another constraint to e.g. access its lentgh leads to an overdetermined sketch.
So - helpful would be a possibility to access "named/labeld" Properties - or - having the properties of "passive constraints" - well - rather ... results in any wa accesible.
This might also facilitate the use of "external geometry" explicit ( in expressions ).
Regards,
Stefan
Re: Named Objects and their properties?
You have reference/driven dimensions for that purpose. There is an icon at the end of the toolbar that changes icons to blue.
-
- Posts: 225
- Joined: Fri Apr 26, 2019 3:14 pm
Re: Named Objects and their properties?
Hi,
You can use the e.g. length definded in any (blue/red) constraint - but - according to my actual knoledge - no derived dimensions.
If you try to add a constraint to name/lable your "derived" vertex you get an overdetermined warning.
Think of a triangel where's given a,b and the angle between a,b - you like to use the length of c in a subsequent sketch as part of an expression.
How to access "c" ?
Regards, Stefan
I'm aware of the "blue" construction elements - but you can't access "dervied" dimension to use them in subsequent sketches.
You can use the e.g. length definded in any (blue/red) constraint - but - according to my actual knoledge - no derived dimensions.
If you try to add a constraint to name/lable your "derived" vertex you get an overdetermined warning.
Think of a triangel where's given a,b and the angle between a,b - you like to use the length of c in a subsequent sketch as part of an expression.
How to access "c" ?
Regards, Stefan
Re: Named Objects and their properties?
Give a name to the blue reference constraint in the elements list.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
-
- Posts: 225
- Joined: Fri Apr 26, 2019 3:14 pm
Re: Named Objects and their properties?
Hi Chris,
we'd talked already in the german forum about this topic and I'd gave it a try.
it's no problem to give a constraint a name - but also with the constuction-type constraints i always got a "overdetermined" warning whenever I tryed to put a constraint onto a vertex which is defined due to other constraints ... ( klicking cancel is th only thing which you could do )
Regards, Stefan
we'd talked already in the german forum about this topic and I'd gave it a try.
it's no problem to give a constraint a name - but also with the constuction-type constraints i always got a "overdetermined" warning whenever I tryed to put a constraint onto a vertex which is defined due to other constraints ... ( klicking cancel is th only thing which you could do )
Regards, Stefan
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Named Objects and their properties?
Rename the blue constraint from context menu in constraint list.
Note that you won't be able to reference the value of the blue constraint in an expression for another constraint in that same sketch. You can do it only across sketches.
Note that you won't be able to reference the value of the blue constraint in an expression for another constraint in that same sketch. You can do it only across sketches.
-
- Posts: 225
- Joined: Fri Apr 26, 2019 3:14 pm
Re: Named Objects and their properties?
Hej,
this is also known. the problem is - that I can't overcom the "overdetermined" Warning. When the length I'm trying to retrieve is defined due to other constraints.
Think of a triangel where's given a,b and the angle between a,b - you like to use the length of c in a subsequent sketch as part of an expression.
How to access the length of "c" ?
Regards, Stefan
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Named Objects and their properties?
I tought my answer was enough. Apparently, not really. Let me elaborate:
1. Draw your triangle, and constrain it.
2. click "Toggle reference/driving constraint" button on constraints toolbar.
->Constraint icons on the toolbar should turn blue.
3. Select the edge you want to measure, apply length constraint.
->The constraint should just appear, you won't get the regular length prompt.
4. Right-click the constraint in constraint list (in task dialog, on the left usually), pick "rename", type the name (e.g. "c"), hit enter.
5. Close the sketch. Now you can refer to that blue constraint value in expressions as Sketch.Constraints.c
1. Draw your triangle, and constrain it.
2. click "Toggle reference/driving constraint" button on constraints toolbar.
->Constraint icons on the toolbar should turn blue.
3. Select the edge you want to measure, apply length constraint.
->The constraint should just appear, you won't get the regular length prompt.
4. Right-click the constraint in constraint list (in task dialog, on the left usually), pick "rename", type the name (e.g. "c"), hit enter.
5. Close the sketch. Now you can refer to that blue constraint value in expressions as Sketch.Constraints.c
-
- Posts: 225
- Joined: Fri Apr 26, 2019 3:14 pm
Re: Named Objects and their properties?
Thanks a lot - I must have previously done something - well - very wrong - using your step-by-step description it works like a charm.DeepSOIC wrote: ↑Fri Aug 23, 2019 12:46 pm I tought my answer was enough. Apparently, not really. Let me elaborate:
1. Draw your triangle, and constrain it.
2. click "Toggle reference/driving constraint" button on constraints toolbar.
->Constraint icons on the toolbar should turn blue.
3. Select the edge you want to measure, apply length constraint.
->The constraint should just appear, you won't get the regular length prompt.
4. Right-click the constraint in constraint list (in task dialog, on the left usually), pick "rename", type the name (e.g. "c"), hit enter.
5. Close the sketch. Now you can refer to that blue constraint value in expressions as Sketch.Constraints.c
I Think I tried to constrain a (blue) construcion line using a regular /driving constraint.
Is there a way to retrieve the arc length of a circle / or the lenght of a part of a circle too (wihtout calculating it using angle, pi and diameter ) ?
Regards, Stefan
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Named Objects and their properties?
Not with a blue constraint. But you can refer to it as Sketch.Shape.Edge56.Length (replace 56 with the right number), as long as the edge is not a construction edge. This method is of course prone to referring to a wrong edge if you change the sketch.C_h_o_p_i_n wrote: ↑Fri Aug 23, 2019 3:52 pm Is there a way to retrieve the arc length of a circle / or the lenght of a part of a circle too (wihtout calculating it using angle, pi and diameter ) ?