Edit sketch without changing the view

Report observations made with the new Toponaming branch.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
Boogieman
Posts: 34
Joined: Wed Apr 18, 2018 9:03 am

Edit sketch without changing the view

Post by Boogieman »

I tried for a while now and i could not find a way to edit a sketch without FreeCAD automatically changing the viewport.

It can be annoying if the view is always changed to a perpendicular view. Sometimes one only wants to change some parameters in the sketch and see the changes in the resulting model. I those situations one has to always change to view back manually. Other CAD software does not force you to always have a perpendicular viewport.

In a document with a Sketch called 'Sketch' it works to paste the following lines in the python console. This resets the view. But i cannot get it to work with a macro.

Code: Select all

a = App.ActiveDocument
g = Gui.ActiveDocument

g.setEdit("Sketch",0)
a.getObject('Sketch').ViewObject.TempoVis.restore()
What am i doing wrong?
Is there such a function already implemented somewhere and i just cannot find it?
Wouldn't it be good to set it in preferences or sketch properties if one wants to change the view or not?
User avatar
bambuko
Veteran
Posts: 2161
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Re: Edit sketch without changing the view

Post by bambuko »

assuming I understood your question correctly?
Screenshot_20230401_182534.png
Screenshot_20230401_182534.png (132.42 KiB) Viewed 6030 times
I am using Link branch and Assembly3
you can also download ... and try it here
excellent Assembly3 tutorials here
User avatar
Boogieman
Posts: 34
Joined: Wed Apr 18, 2018 9:03 am

Re: Edit sketch without changing the view

Post by Boogieman »

Thanks that's exactly what i was looking for.
Don't know why i didn't see it before though.
User avatar
bambuko
Veteran
Posts: 2161
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Re: Edit sketch without changing the view

Post by bambuko »

we all suffer from occasional blindness (my excuse is old age and decrepitude :lol: )
I am using Link branch and Assembly3
you can also download ... and try it here
excellent Assembly3 tutorials here
freedman
Veteran
Posts: 3440
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Edit sketch without changing the view

Post by freedman »

If you look in some of my macros you can find the code. I have an option to Sketch in a 3D view i.e. the current 3D view stays even when sketching. This took time to figure out, saving camera views and ultimately using a timer to reset the view once in Sketcher. Once in Sketcher a button can be used to toggle the Sketch 2D (FreeCAD default) or 3D (the prior view).
Post Reply