[resolved] tons of 'Links go out of the allowed scope' warnings

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

[resolved] tons of 'Links go out of the allowed scope' warnings

Post by uwestoehr »

When constructing real-life things, I always end up with tons of these warnings:

Code: Select all

Links go out of the allowed scope

This is also in FC 0.19 so no regression, but annoying since the report panel is filled and it provides no useful information what is wrong.

To me it seems that nothing is actually wrong:
- take for example this simple sketch:
Part-taper-example.FCStd
(6.35 KiB) Downloaded 38 times
- extrude it using Part's Extrude feature with its default settings


Do you get the warnings too and what do I have to do to avoid them? Or is it a bug that these warnings are issued?
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: tons of 'Links go out of the allowed scope' warnings

Post by chrisb »

You must not cross Body borders with references. From outside of a body, e.g. from Part workbench you have always to use the whole body for operations and not a feature or a sketch inside.
I appreciate to see that you start learning to use FreeCAD :) .
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: tons of 'Links go out of the allowed scope' warnings

Post by uwestoehr »

chrisb wrote: Sat Jan 08, 2022 4:46 pm You must not cross Body borders with references. From outside of a body, e.g. from Part workbench you have always to use the whole body for operations and not a feature or a sketch inside.

Thanks.
But then the error message must state this. As it is it is completely meaningless.

chrisb wrote: Sat Jan 08, 2022 4:46 pm I appreciate to see that you start learning to use FreeCAD.
Unnecessary comment.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: tons of 'Links go out of the allowed scope' warnings

Post by adrianinsaval »

uwestoehr wrote: Sat Jan 08, 2022 4:55 pm As it is it is completely meaningless.
+1
Various warnings in FreeCAD provide no information to figure out what is wrong, and they don't mention what specific feature triggered the warning so it might not be obvious which you should be checking to begin with. I've come across some very useless "check report view" errors and then there's nothing else in the report view :?
Is there another situation that might trigger the "Links go out of the allowed scope" warning besides what you mentioned chris? Or should it just be changed to mention the body situation every time.
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: tons of 'Links go out of the allowed scope' warnings

Post by carlopav »

adrianinsaval wrote: Mon Jan 10, 2022 1:19 pm Is there another situation that might trigger the "Links go out of the allowed scope" warning besides what you mentioned chris? Or should it just be changed to mention the body situation every time.
It is triggered whenever a Link property points to a different coordinate system object, without being an "App::PropertyLinkGlobal" property. So that's probably the case of App::Part, PartDesign::Body, probably in general objects that have "App::GeoFeatureGroupExtension" or "App::OriginGroupExtension".

Changing a "App::PropertyLink" or a "App::PropertyLinkChild" to "App::PropertyLinkGlobal" is possible, but additional code to recompute the relative local placement of the object would be needed.

Edit: also a change in the global placement of the pointed object (obj B) caused by a change of the placement of its container, would not generate a signal catched by the onChanged method of the first object (obj A)...
follow my experiments on BIM modelling for architecture design
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: tons of 'Links go out of the allowed scope' warnings

Post by TheMarkster »

Consider this file. The sketch is attached to the face of the box, but because the sketch is outside the body the link is out of the allowed scope. When the body is moved the sketch, unexpectedly, does not follow it. This is the purpose of the warning. As long as you don't move the body you can ignore the warning. (Obviously, we should not be attaching to faces at this time, but this is just an example.)
Snip macro screenshot-b0c76b.png
Snip macro screenshot-b0c76b.png (56.58 KiB) Viewed 2668 times
Attachments
link_out_of_scope.FCStd
(9.35 KiB) Downloaded 36 times
kisolre
Veteran
Posts: 4162
Joined: Wed Nov 21, 2018 1:13 pm

Re: tons of 'Links go out of the allowed scope' warnings

Post by kisolre »

And having something like "Sketch: links go out of the allowed scope" would be far more informative and hint the user where to find those links if they need to be fixed.
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: tons of 'Links go out of the allowed scope' warnings

Post by chrisb »

I think the error message itself is not wrong. It says what it is: There is a reference to something which is not not allowed in the context where it is used. To add the object causing it would be great though.
If I may vote which error message should be improved first, I vote for "BRep_API: command not done" :mrgreen: .
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: tons of 'Links go out of the allowed scope' warnings

Post by uwestoehr »

TheMarkster wrote: Tue Jan 11, 2022 4:59 am Consider this file.
Thanks to all who posted. I understand the issue but I want to improve the situation of course. ;)

So @TheMarkster, maybe you have a proposal on how to refine the message output? Ideally it would tell the users what is _actually_ going wrong. So as in your example it must mention that the sketch is not part of the body.
aapo
Posts: 615
Joined: Mon Oct 29, 2018 6:41 pm

Re: tons of 'Links go out of the allowed scope' warnings

Post by aapo »

uwestoehr wrote: Wed Jan 12, 2022 11:17 am So @TheMarkster, maybe you have a proposal on how to refine the message output? Ideally it would tell the users what is _actually_ going wrong. So as in your example it must mention that the sketch is not part of the body.
I think the 'Links go out of the allowed scope' is fine, but it would be indeed helpful for the user to tell:
  • What object is linked, i.e. the target object that triggers the error
  • To which object it is child of, i.e. what is this "forbidden scope"
  • To which object it should be child of, i.e. what object/container is the "allowed scope". Presumably this is known, because we know that the link actually points to somewhere else (hence the error)
So, optimally the error could give away all the three objects involved: "Link(s) to object '%1' go out of the allowed scope '%2': linked object is within the scope '%3'." or something similar.
Post Reply