Can't disable operation with dress up

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
Wsk8
Posts: 182
Joined: Fri Dec 07, 2018 6:24 pm

Can't disable operation with dress up

Post by Wsk8 »

Hello,

just found out, that you can't disable a operation with a dress up. The dress up doesn't has the "active" option and if you disable the underlaying operation, freecad marks it as faulty. Bug? Error?

https://github.com/FreeCAD/FreeCAD/rele ... g/0.18_pre

mfg
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: Can't disable operation with dress up

Post by mlampert »

Sounds like a bug to me - could you file a bug report?
User avatar
jmr
Posts: 35
Joined: Fri Feb 09, 2018 3:32 pm

Re: Can't disable operation with dress up

Post by jmr »

Well, that is probably on the todo list, or could be already fixed in some other repository. I'm not sure but maybe in Sliptonic's WCS feature, where he added a button to toggle the operation active/inactive. I'm not sure if it worked for dressups. Ok I did a quick check, and it did not work for RampEntry. But it seems like an easy fix, as the dressup should just see if the underlying op is active or not or should have the property on its own. I think I could try to fix that and that would be a first time to try and push something into the master.
There is still more around the corner, like not being able to make an array of dressed-up paths, and trying to dress up an array not better either.
Edit: waiting for the kernel to compile I looked at PathDressupRampEntry.py.

Code: Select all

    def execute(self, obj):
        if not obj.Base:
            return
        if not obj.Base.isDerivedFrom("Path::Feature"):
            return
        if not obj.Base.Path:
            return
        if (obj.Base.Active == False):
            print ("not using this")  
            obj.Path = self.createCommands(obj, [])
            return
        else:
            print ("using this") 
This works. But I see a problem, it will break when I put a dressup on a dressup. I'm not sure how should I handle this, any ideas? Should I do some kind of looping up obj.Base.Base up until isDerivedFrom("Path::Feature") no longer returns true looking for Active property? Or to add checking for the Active property and then copying that to hidden Active property in the dressup - this way user would not change that but other dressup would see it?
User avatar
Wsk8
Posts: 182
Joined: Fri Dec 07, 2018 6:24 pm

Re: Can't disable operation with dress up

Post by Wsk8 »

jmr wrote: Sun Mar 24, 2019 7:41 pm This works. But I see a problem, it will break when I put a dressup on a dressup. I'm not sure how should I handle this, any ideas? Should I do some kind of looping up obj.Base.Base up until isDerivedFrom("Path::Feature") no longer returns true looking for Active property? Or to add checking for the Active property and then copying that to hidden Active property in the dressup - this way user would not change that but other dressup would see it?
I think it would be best, if all dress-ups just take the active property of the base object as reference. But i'm open for better solutions ;)

Can i apply these changes with a single file or do i need compiled binarys from you to test it?

Another thing that stresses me out, is if i hide a path set-up, it's still visible. Thats the reason why i even discovered the previous bug (Tried to disable all single ops). Do you have a solution for this problem?

mfg
User avatar
jmr
Posts: 35
Joined: Fri Feb 09, 2018 3:32 pm

Re: Can't disable operation with dress up

Post by jmr »

Hi.
This is in python code so it's very easy to modify, no need for recompilation. For me the files are at /opt/FreeCAD/Mod/Path/PathScripts
If you want to see only selected path you have to hide the Job object, otherwise if one of operations is visible it is duplicated (not really always, as operation can have a different "placement" set up, for example rotation for indexed rotary machining, and with visible Job it will not have effect) - it may seem it has no effect.

The question is how to get to the base object, as with Contour, dressed up with Tag and then with ramp entry, the base for ramp will be the tag dressup. I believe it will be ok if dressup will have its own Active property, not editable by the user but cloned from the "base" object - this way it will work as a chain of copies. If there is a danger of it breaking or something going wrong I would like to know. Other option is the dressup looking up, trying to find the top base object but that seems more complicated for a python noob like me.
User avatar
Wsk8
Posts: 182
Joined: Fri Dec 07, 2018 6:24 pm

Re: Can't disable operation with dress up

Post by Wsk8 »

I'm not sure if i understood you correct...
Just to clarify, if i hide the red circled setup, i want to hide it completely (Stock, Object, paths), so the screen is empty. Right now if i hide it, nothing happens, everything is still visible.

mfg
Attachments
fc.png
fc.png (16.36 KiB) Viewed 1264 times
User avatar
jmr
Posts: 35
Joined: Fri Feb 09, 2018 3:32 pm

Re: Can't disable operation with dress up

Post by jmr »

This is expected, or I just elieve it is normal.
You need to hide (as with the space bar) the Base-Body001 and Stock001 too. Does that help?
User avatar
Wsk8
Posts: 182
Joined: Fri Dec 07, 2018 6:24 pm

Re: Can't disable operation with dress up

Post by Wsk8 »

Well, Body and stock are hidden, yes. But the paths (green and red lines) of each operation are still visible. But if you use dress-ups, you can't hide (deactivate) the paths. And it's also a lot of tedious work to hide every object and then do the same again to make it visible.

mfg
User avatar
jmr
Posts: 35
Joined: Fri Feb 09, 2018 3:32 pm

Re: Can't disable operation with dress up

Post by jmr »

Are the operations inside the "Operations"? In the picture it looks empty.
You should not have to hide them. If they are hidden (each one of them), all of them can be made visible/invisible when you hide the Job object. That looks more like 0.17, I think it was like that already in that version, but I am not sure about dressups. They should make the original path invisible.
I hide the Job and unhide a path I am working on so the view is more clear.
Also, to be more correct, hiding/showing should not be confused with enable/disable or maybe it can be called like that and I just confused that for active/inactive - which is the only thing to cause the gcode not to be present in the final output. It also makes it invisible since there is no code. Sorry if that's my mistake.
User avatar
Wsk8
Posts: 182
Joined: Fri Dec 07, 2018 6:24 pm

Re: Can't disable operation with dress up

Post by Wsk8 »

There are no operations, therefore you can't see them. I just created a setup for this screenshot.
But i tried hiding everything like you said and this seems to work. Still it would be better if everything would be hidden just by hiding the setup. Do you have any idea there to find the right part in the code to implement this?

BTW
I tried your dress-up changes and it works.

mfg
Post Reply