View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004139 | PartDesign | Bug | public | 2019-09-20 18:33 | 2021-03-29 09:00 |
Reporter | DeeJayOne | Assigned To | wmayer | ||
Priority | high | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | x86-64 | OS | Windows | OS Version | 10 |
Product Version | 0.18 | ||||
Target Version | 0.20 | ||||
Summary | 0004139: v0.18-16131 - Macro - SubtractivePipe attached path object issues after macro executed. | ||||
Description | I have tried to capture a macro while drawing a body which is containing a SubtractivePipe object. When, I play the generated macro file, I have 2 errors displayed (on the body -> "Tip shape is empty" and the Subtractive part -> "No spine linked") 1) I have first checked the sweep properties of the SubtractivePipe and I can see that the attached path object is void. So it explains why errors occur. Then, if I launch the GUI guest settings for the SubtractivePipe, I can newly type the attached path object, then validate and all is done. 2) I have added a python cmd in the script to add the attached path object to the subtractivePipe. Then, I have played the macro file but the 2 errors are always here. I can see on the properties that the attached object (a sketch in my case) is well typed, so I can say that the macro script is now OK. But when I newly launch the GUI guest settings, I can see that there is no attached path object. How is it possible ? I need manually type the attached path object via the GUI guest setting of the Subtractive object to solve the problem. In case of automatic macro usage, it is very annoying. | ||||
Steps To Reproduce | Start the macro recording 1) Select the PartDesign mode 2) Draw a cube via a sketch and a pad. 3) Draw a "path" sketch with a line that throws the cube. 4) Draw a "profile" sketch with a circle at the normal of the path line. 5) Draw a subtractivePipe by selecting first the profile sketch. Select the path line as the attached path object, then valid the operation. 7) Stop the macro recording Then create a new file, create a new body and then execute the macro file previously recorded. | ||||
Additional Information | I have also played the generated macro file with v0.19-18234 and I have also the error message "No spine linked" on the Subtractive object. (same pb. as v0.18) But this time, I don't have the error message on the body. | ||||
Tags | #pending | ||||
FreeCAD Information | |||||
|
The macro recorded file I have used and a modified version which includes the attached path object for the SubtractivePipe. Test_SubtractivePipe_modified.FCMacro (10,002 bytes)
# -*- coding: utf-8 -*- # Macro Begin: C:\Users\deeja\AppData\Roaming\FreeCAD\Macro\Test_SubtractivePipe.FCMacro +++++++++++++++++++++++++++++++++++++++++++++++++ import FreeCAD import PartDesign import PartDesignGui import Sketcher App.newDocument("Sans nom") #App.setActiveDocument("Sans_nom") #App.ActiveDocument=App.getDocument("Sans_nom") #Gui.ActiveDocument=Gui.getDocument("Sans_nom") #Gui.activeDocument().activeView().viewDefaultOrientation() App.activeDocument().addObject('PartDesign::Body','Body') #Gui.activateView('Gui::View3DInventor', True) #Gui.activeView().setActiveObject('pdbody', App.activeDocument().Body) App.activeDocument().Body.newObject('Sketcher::SketchObject','Sketch') App.activeDocument().Sketch.Support = (App.activeDocument().XY_Plane, ['']) App.activeDocument().Sketch.MapMode = 'FlatFace' App.ActiveDocument.recompute() #Gui.activeDocument().setEdit('Sketch') #Gui.activateWorkbench('SketcherWorkbench') #ActiveSketch = App.ActiveDocument.getObject('Sketch') #tv = Show.TempoVis(App.ActiveDocument) #if ActiveSketch.ViewObject.HideDependent: # objs = tv.get_all_dependent(ActiveSketch) # objs = filter(lambda x: not x.TypeId.startswith("TechDraw::"), objs) # objs = filter(lambda x: not x.TypeId.startswith("Drawing::"), objs) # tv.hide(objs) #if ActiveSketch.ViewObject.ShowSupport: # tv.show([ref[0] for ref in ActiveSketch.Support if not ref[0].isDerivedFrom("PartDesign::Plane")]) #if ActiveSketch.ViewObject.ShowLinks: # tv.show([ref[0] for ref in ActiveSketch.ExternalGeometry]) #tv.hide(ActiveSketch) #ActiveSketch.ViewObject.TempoVis = tv #del(tv) # #ActiveSketch = App.ActiveDocument.getObject('Sketch') #if ActiveSketch.ViewObject.RestoreCamera: # ActiveSketch.ViewObject.TempoVis.saveCamera() # geoList = [] geoList.append(Part.LineSegment(App.Vector(-12.439816,13.332624,0),App.Vector(13.987350,13.332624,0))) geoList.append(Part.LineSegment(App.Vector(13.987350,13.332624,0),App.Vector(13.987350,-14.999204,0))) geoList.append(Part.LineSegment(App.Vector(13.987350,-14.999204,0),App.Vector(-12.439816,-14.999204,0))) geoList.append(Part.LineSegment(App.Vector(-12.439816,-14.999204,0),App.Vector(-12.439816,13.332624,0))) App.ActiveDocument.Sketch.addGeometry(geoList,False) conList = [] conList.append(Sketcher.Constraint('Coincident',0,2,1,1)) conList.append(Sketcher.Constraint('Coincident',1,2,2,1)) conList.append(Sketcher.Constraint('Coincident',2,2,3,1)) conList.append(Sketcher.Constraint('Coincident',3,2,0,1)) conList.append(Sketcher.Constraint('Horizontal',0)) conList.append(Sketcher.Constraint('Horizontal',2)) conList.append(Sketcher.Constraint('Vertical',1)) conList.append(Sketcher.Constraint('Vertical',3)) App.ActiveDocument.Sketch.addConstraint(conList) App.ActiveDocument.recompute() #Gui.activeDocument().resetEdit() #ActiveSketch = App.ActiveDocument.getObject('Sketch') #tv = ActiveSketch.ViewObject.TempoVis #if tv: # tv.restore() #ActiveSketch.ViewObject.TempoVis = None #del(tv) # #Gui.activateWorkbench('PartDesignWorkbench') App.ActiveDocument.recompute() #Gui.activeDocument().activeView().viewIsometric() App.activeDocument().Body.newObject("PartDesign::Pad","Pad") App.activeDocument().Pad.Profile = App.activeDocument().Sketch App.activeDocument().Pad.Length = 10.0 App.ActiveDocument.recompute() #Gui.activeDocument().hide("Sketch") App.ActiveDocument.recompute() #Gui.ActiveDocument.Pad.ShapeColor=Gui.ActiveDocument.Body.ShapeColor #Gui.ActiveDocument.Pad.LineColor=Gui.ActiveDocument.Body.LineColor #Gui.ActiveDocument.Pad.PointColor=Gui.ActiveDocument.Body.PointColor #Gui.ActiveDocument.Pad.Transparency=Gui.ActiveDocument.Body.Transparency #Gui.ActiveDocument.Pad.DisplayMode=Gui.ActiveDocument.Body.DisplayMode #Gui.activeDocument().setEdit('Pad', 0) #Gui.Selection.clearSelection() #Gui.activeDocument().hide("Sketch") App.ActiveDocument.Pad.Length = 30.000000 App.ActiveDocument.Pad.Length2 = 100.000000 App.ActiveDocument.Pad.Type = 0 App.ActiveDocument.Pad.UpToFace = None App.ActiveDocument.Pad.Reversed = 0 App.ActiveDocument.Pad.Midplane = 0 App.ActiveDocument.Pad.Offset = 0.000000 App.ActiveDocument.recompute() #Gui.activeDocument().resetEdit() #Gui.SendMsgToActiveView("ViewFit") App.activeDocument().Body.newObject('Sketcher::SketchObject','Sketch001') App.activeDocument().Sketch001.Support = (App.activeDocument().XZ_Plane, ['']) App.activeDocument().Sketch001.MapMode = 'FlatFace' App.ActiveDocument.recompute() #Gui.activeDocument().setEdit('Sketch001') #Gui.activateWorkbench('SketcherWorkbench') #ActiveSketch = App.ActiveDocument.getObject('Sketch001') #tv = Show.TempoVis(App.ActiveDocument) #if ActiveSketch.ViewObject.HideDependent: # objs = tv.get_all_dependent(ActiveSketch) # objs = filter(lambda x: not x.TypeId.startswith("TechDraw::"), objs) # objs = filter(lambda x: not x.TypeId.startswith("Drawing::"), objs) # tv.hide(objs) #if ActiveSketch.ViewObject.ShowSupport: # tv.show([ref[0] for ref in ActiveSketch.Support if not ref[0].isDerivedFrom("PartDesign::Plane")]) #if ActiveSketch.ViewObject.ShowLinks: # tv.show([ref[0] for ref in ActiveSketch.ExternalGeometry]) #tv.hide(ActiveSketch) #ActiveSketch.ViewObject.TempoVis = tv #del(tv) # #ActiveSketch = App.ActiveDocument.getObject('Sketch001') #if ActiveSketch.ViewObject.RestoreCamera: # ActiveSketch.ViewObject.TempoVis.saveCamera() # App.ActiveDocument.Sketch001.addGeometry(Part.LineSegment(App.Vector(-24.063456,8.601261,0),App.Vector(18.286116,20.472610,0)),False) App.ActiveDocument.recompute() #Gui.activeDocument().resetEdit() #ActiveSketch = App.ActiveDocument.getObject('Sketch001') #tv = ActiveSketch.ViewObject.TempoVis #if tv: # tv.restore() #ActiveSketch.ViewObject.TempoVis = None #del(tv) # #Gui.activateWorkbench('PartDesignWorkbench') App.ActiveDocument.recompute() #Gui.activeDocument().setEdit('Sketch001') #Gui.activateWorkbench('SketcherWorkbench') #ActiveSketch = App.ActiveDocument.getObject('Sketch001') #tv = Show.TempoVis(App.ActiveDocument) #if ActiveSketch.ViewObject.HideDependent: # objs = tv.get_all_dependent(ActiveSketch) # objs = filter(lambda x: not x.TypeId.startswith("TechDraw::"), objs) # objs = filter(lambda x: not x.TypeId.startswith("Drawing::"), objs) # tv.hide(objs) #if ActiveSketch.ViewObject.ShowSupport: # tv.show([ref[0] for ref in ActiveSketch.Support if not ref[0].isDerivedFrom("PartDesign::Plane")]) #if ActiveSketch.ViewObject.ShowLinks: # tv.show([ref[0] for ref in ActiveSketch.ExternalGeometry]) #tv.hide(ActiveSketch) #ActiveSketch.ViewObject.TempoVis = tv #del(tv) # #ActiveSketch = App.ActiveDocument.getObject('Sketch001') #if ActiveSketch.ViewObject.RestoreCamera: # ActiveSketch.ViewObject.TempoVis.saveCamera() # #Gui.activeDocument().activeView().viewIsometric() #Gui.getDocument('Sans_nom').resetEdit() #ActiveSketch = App.ActiveDocument.getObject('Sketch001') #tv = ActiveSketch.ViewObject.TempoVis #if tv: # tv.restore() #ActiveSketch.ViewObject.TempoVis = None #del(tv) # #Gui.activateWorkbench('PartDesignWorkbench') App.getDocument('Sans_nom').recompute() App.activeDocument().Body.newObject('Sketcher::SketchObject','Sketch002') App.activeDocument().Sketch002.Support = (App.activeDocument().YZ_Plane, ['']) App.activeDocument().Sketch002.MapMode = 'FlatFace' App.ActiveDocument.recompute() #Gui.activeDocument().setEdit('Sketch002') #Gui.activateWorkbench('SketcherWorkbench') #ActiveSketch = App.ActiveDocument.getObject('Sketch002') #tv = Show.TempoVis(App.ActiveDocument) #if ActiveSketch.ViewObject.HideDependent: # objs = tv.get_all_dependent(ActiveSketch) # objs = filter(lambda x: not x.TypeId.startswith("TechDraw::"), objs) # objs = filter(lambda x: not x.TypeId.startswith("Drawing::"), objs) # tv.hide(objs) #if ActiveSketch.ViewObject.ShowSupport: # tv.show([ref[0] for ref in ActiveSketch.Support if not ref[0].isDerivedFrom("PartDesign::Plane")]) #if ActiveSketch.ViewObject.ShowLinks: # tv.show([ref[0] for ref in ActiveSketch.ExternalGeometry]) #tv.hide(ActiveSketch) #ActiveSketch.ViewObject.TempoVis = tv #del(tv) # #ActiveSketch = App.ActiveDocument.getObject('Sketch002') #if ActiveSketch.ViewObject.RestoreCamera: # ActiveSketch.ViewObject.TempoVis.saveCamera() # App.ActiveDocument.Sketch002.addGeometry(Part.Circle(App.Vector(0.493656,20.770469,0),App.Vector(0,0,1),6.841867),False) App.ActiveDocument.recompute() App.ActiveDocument.Sketch002.addExternal("Sketch001","Edge1") App.ActiveDocument.recompute() App.ActiveDocument.Sketch002.addConstraint(Sketcher.Constraint('Coincident',0,3,-3,2)) App.ActiveDocument.recompute() #Gui.activeDocument().resetEdit() #ActiveSketch = App.ActiveDocument.getObject('Sketch002') #tv = ActiveSketch.ViewObject.TempoVis #if tv: # tv.restore() #ActiveSketch.ViewObject.TempoVis = None #del(tv) # #Gui.activateWorkbench('PartDesignWorkbench') App.ActiveDocument.recompute() App.activeDocument().Body.newObject("PartDesign::SubtractivePipe","SubtractivePipe") App.activeDocument().SubtractivePipe.Profile = App.activeDocument().Sketch002 App.ActiveDocument.recompute() #Gui.activeDocument().hide("Sketch002") App.ActiveDocument.recompute() # *** Add the missing line while the macro capture process * FreeCAD.getDocument("Sans_nom").getObject("SubtractivePipe").Sections = [App.getDocument('Sans_nom').getObject('Sketch001')] App.activeDocument().recompute() #Gui.ActiveDocument.SubtractivePipe.ShapeColor=Gui.ActiveDocument.Body.ShapeColor #Gui.ActiveDocument.SubtractivePipe.LineColor=Gui.ActiveDocument.Body.LineColor #Gui.ActiveDocument.SubtractivePipe.PointColor=Gui.ActiveDocument.Body.PointColor #Gui.ActiveDocument.SubtractivePipe.Transparency=Gui.ActiveDocument.Body.Transparency #Gui.ActiveDocument.SubtractivePipe.DisplayMode=Gui.ActiveDocument.Body.DisplayMode #Gui.activeDocument().setEdit('SubtractivePipe', 0) #Gui.Selection.clearSelection() App.ActiveDocument.recompute() #Gui.activeDocument().resetEdit() # Macro End: C:\Users\deeja\AppData\Roaming\FreeCAD\Macro\Test_SubtractivePipe.FCMacro +++++++++++++++++++++++++++++++++++++++++++++++++ Test_SubtractivePipe_org.FCMacro (9,781 bytes)
# -*- coding: utf-8 -*- # Macro Begin: C:\Users\deeja\AppData\Roaming\FreeCAD\Macro\Test_SubtractivePipe.FCMacro +++++++++++++++++++++++++++++++++++++++++++++++++ import FreeCAD import PartDesign import PartDesignGui import Sketcher App.newDocument("Sans nom") #App.setActiveDocument("Sans_nom") #App.ActiveDocument=App.getDocument("Sans_nom") #Gui.ActiveDocument=Gui.getDocument("Sans_nom") #Gui.activeDocument().activeView().viewDefaultOrientation() App.activeDocument().addObject('PartDesign::Body','Body') #Gui.activateView('Gui::View3DInventor', True) #Gui.activeView().setActiveObject('pdbody', App.activeDocument().Body) App.activeDocument().Body.newObject('Sketcher::SketchObject','Sketch') App.activeDocument().Sketch.Support = (App.activeDocument().XY_Plane, ['']) App.activeDocument().Sketch.MapMode = 'FlatFace' App.ActiveDocument.recompute() #Gui.activeDocument().setEdit('Sketch') #Gui.activateWorkbench('SketcherWorkbench') #ActiveSketch = App.ActiveDocument.getObject('Sketch') #tv = Show.TempoVis(App.ActiveDocument) #if ActiveSketch.ViewObject.HideDependent: # objs = tv.get_all_dependent(ActiveSketch) # objs = filter(lambda x: not x.TypeId.startswith("TechDraw::"), objs) # objs = filter(lambda x: not x.TypeId.startswith("Drawing::"), objs) # tv.hide(objs) #if ActiveSketch.ViewObject.ShowSupport: # tv.show([ref[0] for ref in ActiveSketch.Support if not ref[0].isDerivedFrom("PartDesign::Plane")]) #if ActiveSketch.ViewObject.ShowLinks: # tv.show([ref[0] for ref in ActiveSketch.ExternalGeometry]) #tv.hide(ActiveSketch) #ActiveSketch.ViewObject.TempoVis = tv #del(tv) # #ActiveSketch = App.ActiveDocument.getObject('Sketch') #if ActiveSketch.ViewObject.RestoreCamera: # ActiveSketch.ViewObject.TempoVis.saveCamera() # geoList = [] geoList.append(Part.LineSegment(App.Vector(-12.439816,13.332624,0),App.Vector(13.987350,13.332624,0))) geoList.append(Part.LineSegment(App.Vector(13.987350,13.332624,0),App.Vector(13.987350,-14.999204,0))) geoList.append(Part.LineSegment(App.Vector(13.987350,-14.999204,0),App.Vector(-12.439816,-14.999204,0))) geoList.append(Part.LineSegment(App.Vector(-12.439816,-14.999204,0),App.Vector(-12.439816,13.332624,0))) App.ActiveDocument.Sketch.addGeometry(geoList,False) conList = [] conList.append(Sketcher.Constraint('Coincident',0,2,1,1)) conList.append(Sketcher.Constraint('Coincident',1,2,2,1)) conList.append(Sketcher.Constraint('Coincident',2,2,3,1)) conList.append(Sketcher.Constraint('Coincident',3,2,0,1)) conList.append(Sketcher.Constraint('Horizontal',0)) conList.append(Sketcher.Constraint('Horizontal',2)) conList.append(Sketcher.Constraint('Vertical',1)) conList.append(Sketcher.Constraint('Vertical',3)) App.ActiveDocument.Sketch.addConstraint(conList) App.ActiveDocument.recompute() #Gui.activeDocument().resetEdit() #ActiveSketch = App.ActiveDocument.getObject('Sketch') #tv = ActiveSketch.ViewObject.TempoVis #if tv: # tv.restore() #ActiveSketch.ViewObject.TempoVis = None #del(tv) # #Gui.activateWorkbench('PartDesignWorkbench') App.ActiveDocument.recompute() #Gui.activeDocument().activeView().viewIsometric() App.activeDocument().Body.newObject("PartDesign::Pad","Pad") App.activeDocument().Pad.Profile = App.activeDocument().Sketch App.activeDocument().Pad.Length = 10.0 App.ActiveDocument.recompute() #Gui.activeDocument().hide("Sketch") App.ActiveDocument.recompute() #Gui.ActiveDocument.Pad.ShapeColor=Gui.ActiveDocument.Body.ShapeColor #Gui.ActiveDocument.Pad.LineColor=Gui.ActiveDocument.Body.LineColor #Gui.ActiveDocument.Pad.PointColor=Gui.ActiveDocument.Body.PointColor #Gui.ActiveDocument.Pad.Transparency=Gui.ActiveDocument.Body.Transparency #Gui.ActiveDocument.Pad.DisplayMode=Gui.ActiveDocument.Body.DisplayMode #Gui.activeDocument().setEdit('Pad', 0) #Gui.Selection.clearSelection() #Gui.activeDocument().hide("Sketch") App.ActiveDocument.Pad.Length = 30.000000 App.ActiveDocument.Pad.Length2 = 100.000000 App.ActiveDocument.Pad.Type = 0 App.ActiveDocument.Pad.UpToFace = None App.ActiveDocument.Pad.Reversed = 0 App.ActiveDocument.Pad.Midplane = 0 App.ActiveDocument.Pad.Offset = 0.000000 App.ActiveDocument.recompute() #Gui.activeDocument().resetEdit() #Gui.SendMsgToActiveView("ViewFit") App.activeDocument().Body.newObject('Sketcher::SketchObject','Sketch001') App.activeDocument().Sketch001.Support = (App.activeDocument().XZ_Plane, ['']) App.activeDocument().Sketch001.MapMode = 'FlatFace' App.ActiveDocument.recompute() #Gui.activeDocument().setEdit('Sketch001') #Gui.activateWorkbench('SketcherWorkbench') #ActiveSketch = App.ActiveDocument.getObject('Sketch001') #tv = Show.TempoVis(App.ActiveDocument) #if ActiveSketch.ViewObject.HideDependent: # objs = tv.get_all_dependent(ActiveSketch) # objs = filter(lambda x: not x.TypeId.startswith("TechDraw::"), objs) # objs = filter(lambda x: not x.TypeId.startswith("Drawing::"), objs) # tv.hide(objs) #if ActiveSketch.ViewObject.ShowSupport: # tv.show([ref[0] for ref in ActiveSketch.Support if not ref[0].isDerivedFrom("PartDesign::Plane")]) #if ActiveSketch.ViewObject.ShowLinks: # tv.show([ref[0] for ref in ActiveSketch.ExternalGeometry]) #tv.hide(ActiveSketch) #ActiveSketch.ViewObject.TempoVis = tv #del(tv) # #ActiveSketch = App.ActiveDocument.getObject('Sketch001') #if ActiveSketch.ViewObject.RestoreCamera: # ActiveSketch.ViewObject.TempoVis.saveCamera() # App.ActiveDocument.Sketch001.addGeometry(Part.LineSegment(App.Vector(-24.063456,8.601261,0),App.Vector(18.286116,20.472610,0)),False) App.ActiveDocument.recompute() #Gui.activeDocument().resetEdit() #ActiveSketch = App.ActiveDocument.getObject('Sketch001') #tv = ActiveSketch.ViewObject.TempoVis #if tv: # tv.restore() #ActiveSketch.ViewObject.TempoVis = None #del(tv) # #Gui.activateWorkbench('PartDesignWorkbench') App.ActiveDocument.recompute() #Gui.activeDocument().setEdit('Sketch001') #Gui.activateWorkbench('SketcherWorkbench') #ActiveSketch = App.ActiveDocument.getObject('Sketch001') #tv = Show.TempoVis(App.ActiveDocument) #if ActiveSketch.ViewObject.HideDependent: # objs = tv.get_all_dependent(ActiveSketch) # objs = filter(lambda x: not x.TypeId.startswith("TechDraw::"), objs) # objs = filter(lambda x: not x.TypeId.startswith("Drawing::"), objs) # tv.hide(objs) #if ActiveSketch.ViewObject.ShowSupport: # tv.show([ref[0] for ref in ActiveSketch.Support if not ref[0].isDerivedFrom("PartDesign::Plane")]) #if ActiveSketch.ViewObject.ShowLinks: # tv.show([ref[0] for ref in ActiveSketch.ExternalGeometry]) #tv.hide(ActiveSketch) #ActiveSketch.ViewObject.TempoVis = tv #del(tv) # #ActiveSketch = App.ActiveDocument.getObject('Sketch001') #if ActiveSketch.ViewObject.RestoreCamera: # ActiveSketch.ViewObject.TempoVis.saveCamera() # #Gui.activeDocument().activeView().viewIsometric() #Gui.getDocument('Sans_nom').resetEdit() #ActiveSketch = App.ActiveDocument.getObject('Sketch001') #tv = ActiveSketch.ViewObject.TempoVis #if tv: # tv.restore() #ActiveSketch.ViewObject.TempoVis = None #del(tv) # #Gui.activateWorkbench('PartDesignWorkbench') App.getDocument('Sans_nom').recompute() App.activeDocument().Body.newObject('Sketcher::SketchObject','Sketch002') App.activeDocument().Sketch002.Support = (App.activeDocument().YZ_Plane, ['']) App.activeDocument().Sketch002.MapMode = 'FlatFace' App.ActiveDocument.recompute() #Gui.activeDocument().setEdit('Sketch002') #Gui.activateWorkbench('SketcherWorkbench') #ActiveSketch = App.ActiveDocument.getObject('Sketch002') #tv = Show.TempoVis(App.ActiveDocument) #if ActiveSketch.ViewObject.HideDependent: # objs = tv.get_all_dependent(ActiveSketch) # objs = filter(lambda x: not x.TypeId.startswith("TechDraw::"), objs) # objs = filter(lambda x: not x.TypeId.startswith("Drawing::"), objs) # tv.hide(objs) #if ActiveSketch.ViewObject.ShowSupport: # tv.show([ref[0] for ref in ActiveSketch.Support if not ref[0].isDerivedFrom("PartDesign::Plane")]) #if ActiveSketch.ViewObject.ShowLinks: # tv.show([ref[0] for ref in ActiveSketch.ExternalGeometry]) #tv.hide(ActiveSketch) #ActiveSketch.ViewObject.TempoVis = tv #del(tv) # #ActiveSketch = App.ActiveDocument.getObject('Sketch002') #if ActiveSketch.ViewObject.RestoreCamera: # ActiveSketch.ViewObject.TempoVis.saveCamera() # App.ActiveDocument.Sketch002.addGeometry(Part.Circle(App.Vector(0.493656,20.770469,0),App.Vector(0,0,1),6.841867),False) App.ActiveDocument.recompute() App.ActiveDocument.Sketch002.addExternal("Sketch001","Edge1") App.ActiveDocument.recompute() App.ActiveDocument.Sketch002.addConstraint(Sketcher.Constraint('Coincident',0,3,-3,2)) App.ActiveDocument.recompute() #Gui.activeDocument().resetEdit() #ActiveSketch = App.ActiveDocument.getObject('Sketch002') #tv = ActiveSketch.ViewObject.TempoVis #if tv: # tv.restore() #ActiveSketch.ViewObject.TempoVis = None #del(tv) # #Gui.activateWorkbench('PartDesignWorkbench') App.ActiveDocument.recompute() App.activeDocument().Body.newObject("PartDesign::SubtractivePipe","SubtractivePipe") App.activeDocument().SubtractivePipe.Profile = App.activeDocument().Sketch002 App.ActiveDocument.recompute() #Gui.activeDocument().hide("Sketch002") App.ActiveDocument.recompute() #Gui.ActiveDocument.SubtractivePipe.ShapeColor=Gui.ActiveDocument.Body.ShapeColor #Gui.ActiveDocument.SubtractivePipe.LineColor=Gui.ActiveDocument.Body.LineColor #Gui.ActiveDocument.SubtractivePipe.PointColor=Gui.ActiveDocument.Body.PointColor #Gui.ActiveDocument.SubtractivePipe.Transparency=Gui.ActiveDocument.Body.Transparency #Gui.ActiveDocument.SubtractivePipe.DisplayMode=Gui.ActiveDocument.Body.DisplayMode #Gui.activeDocument().setEdit('SubtractivePipe', 0) #Gui.Selection.clearSelection() App.ActiveDocument.recompute() #Gui.activeDocument().resetEdit() # Macro End: C:\Users\deeja\AppData\Roaming\FreeCAD\Macro\Test_SubtractivePipe.FCMacro +++++++++++++++++++++++++++++++++++++++++++++++++ |
|
Forum associated link (french) |
|
OS: Windows 10 Word size of OS: 64-bit Word size of FreeCAD: 64-bit Version: 0.18.16131 (Git) Build type: Release Branch: releases/FreeCAD-0-18 Hash: 3129ae4296e40ed20e7b3d460b86e6969acbe1c3 Python version: 3.6.6 Qt version: 5.6.2 Coin version: 4.0.0a OCC version: 7.3.0 Locale: French/France (fr_FR) |
|
@DeeJayOne can you reproduce in latest 0.19 |
|
@Kunda1 The problem seems always not solved with FC v0.19.22756. Please see the attached file : The "same" Macro File but recorded with FC v0.19.22756. FC_v0.19-22756_Test_SubtractivePipe_org.FCMacro (12,968 bytes)
# -*- coding: utf-8 -*- # Macro Begin: C:\Users\deeja\AppData\Roaming\FreeCAD\Macro\FC_v0.19-22756_Test_SubtractivePipe_org_v2.FCMacro +++++++++++++++++++++++++++++++++++++++++++++++++ import FreeCAD import PartDesign import PartDesignGui import Sketcher # Gui.runCommand('Std_DlgMacroRecord',0) ### Begin command Std_New App.newDocument("Unnamed") # App.setActiveDocument("Unnamed") # App.ActiveDocument=App.getDocument("Unnamed") # Gui.ActiveDocument=Gui.getDocument("Unnamed") # Gui.activeDocument().activeView().viewDefaultOrientation() ### End command Std_New # Gui.runCommand('Std_OrthographicCamera',1) ### Begin command PartDesign_NewSketch App.getDocument('Unnamed').addObject('PartDesign::Body','Body') # Gui.ActiveDocument.ActiveView.setActiveObject('pdbody',App.getDocument('Unnamed').getObject('Body')) ### End command PartDesign_NewSketch # Gui.Selection.addSelection('Unnamed','Body','Origin.XY_Plane.') App.getDocument('Unnamed').getObject('Body').newObject('Sketcher::SketchObject','Sketch') App.getDocument('Unnamed').getObject('Sketch').Support = (App.getDocument('Unnamed').getObject('XY_Plane'),['']) App.getDocument('Unnamed').getObject('Sketch').MapMode = 'FlatFace' App.ActiveDocument.recompute() Gui.getDocument('Unnamed').setEdit(App.getDocument('Unnamed').getObject('Body'),0,'Sketch.') # import Show # ActiveSketch = App.getDocument('Unnamed').getObject('Sketch') # tv = Show.TempoVis(App.ActiveDocument, tag= ActiveSketch.ViewObject.TypeId) # ActiveSketch.ViewObject.TempoVis = tv # if ActiveSketch.ViewObject.EditingWorkbench: # tv.activateWorkbench(ActiveSketch.ViewObject.EditingWorkbench) # if ActiveSketch.ViewObject.HideDependent: # tv.hide(tv.get_all_dependent(App.getDocument('Unnamed').getObject('Body'), 'Sketch.')) # if ActiveSketch.ViewObject.ShowSupport: # tv.show([ref[0] for ref in ActiveSketch.Support if not ref[0].isDerivedFrom("PartDesign::Plane")]) # if ActiveSketch.ViewObject.ShowLinks: # tv.show([ref[0] for ref in ActiveSketch.ExternalGeometry]) # tv.hide(ActiveSketch) # del(tv) # # ActiveSketch = App.getDocument('Unnamed').getObject('Sketch') # if ActiveSketch.ViewObject.RestoreCamera: # ActiveSketch.ViewObject.TempoVis.saveCamera() # # Gui.Selection.clearSelection() # Gui.runCommand('Sketcher_CreateRectangle',0) geoList = [] geoList.append(Part.LineSegment(App.Vector(-39.800282,39.728958,0),App.Vector(40.085590,39.728958,0))) geoList.append(Part.LineSegment(App.Vector(40.085590,39.728958,0),App.Vector(40.085590,-39.871613,0))) geoList.append(Part.LineSegment(App.Vector(40.085590,-39.871613,0),App.Vector(-39.800282,-39.871613,0))) geoList.append(Part.LineSegment(App.Vector(-39.800282,-39.871613,0),App.Vector(-39.800282,39.728958,0))) App.getDocument('Unnamed').getObject('Sketch').addGeometry(geoList,False) conList = [] conList.append(Sketcher.Constraint('Coincident',0,2,1,1)) conList.append(Sketcher.Constraint('Coincident',1,2,2,1)) conList.append(Sketcher.Constraint('Coincident',2,2,3,1)) conList.append(Sketcher.Constraint('Coincident',3,2,0,1)) conList.append(Sketcher.Constraint('Horizontal',0)) conList.append(Sketcher.Constraint('Horizontal',2)) conList.append(Sketcher.Constraint('Vertical',1)) conList.append(Sketcher.Constraint('Vertical',3)) App.getDocument('Unnamed').getObject('Sketch').addConstraint(conList) App.ActiveDocument.recompute() # Gui.getDocument('Unnamed').resetEdit() App.ActiveDocument.recompute() # ActiveSketch = App.getDocument('Unnamed').getObject('Sketch') # tv = ActiveSketch.ViewObject.TempoVis # if tv: # tv.restore() # ActiveSketch.ViewObject.TempoVis = None # del(tv) # # Gui.Selection.addSelection('Unnamed','Body','Sketch.') App.getDocument('Unnamed').recompute() ### Begin command PartDesign_Pad App.getDocument('Unnamed').getObject('Body').newObject('PartDesign::Pad','Pad') App.getDocument('Unnamed').getObject('Pad').Profile = App.getDocument('Unnamed').getObject('Sketch') App.getDocument('Unnamed').getObject('Pad').Length = 10.0 App.ActiveDocument.recompute() App.getDocument('Unnamed').getObject('Sketch').Visibility = False App.ActiveDocument.recompute() # App.getDocument('Unnamed').getObject('Pad').ViewObject.ShapeColor=getattr(App.getDocument('Unnamed').getObject('Body').getLinkedObject(True).ViewObject,'ShapeColor',App.getDocument('Unnamed').getObject('Pad').ViewObject.ShapeColor) # App.getDocument('Unnamed').getObject('Pad').ViewObject.LineColor=getattr(App.getDocument('Unnamed').getObject('Body').getLinkedObject(True).ViewObject,'LineColor',App.getDocument('Unnamed').getObject('Pad').ViewObject.LineColor) # App.getDocument('Unnamed').getObject('Pad').ViewObject.PointColor=getattr(App.getDocument('Unnamed').getObject('Body').getLinkedObject(True).ViewObject,'PointColor',App.getDocument('Unnamed').getObject('Pad').ViewObject.PointColor) # App.getDocument('Unnamed').getObject('Pad').ViewObject.Transparency=getattr(App.getDocument('Unnamed').getObject('Body').getLinkedObject(True).ViewObject,'Transparency',App.getDocument('Unnamed').getObject('Pad').ViewObject.Transparency) # App.getDocument('Unnamed').getObject('Pad').ViewObject.DisplayMode=getattr(App.getDocument('Unnamed').getObject('Body').getLinkedObject(True).ViewObject,'DisplayMode',App.getDocument('Unnamed').getObject('Pad').ViewObject.DisplayMode) Gui.getDocument('Unnamed').setEdit(App.getDocument('Unnamed').getObject('Body'),0,'Pad.') # Gui.Selection.clearSelection() ### End command PartDesign_Pad # Gui.Selection.clearSelection() App.getDocument('Unnamed').getObject('Sketch').Visibility = False App.getDocument('Unnamed').getObject('Pad').Length = 100.000000 App.getDocument('Unnamed').getObject('Pad').Length2 = 100.000000 App.getDocument('Unnamed').getObject('Pad').UseCustomVector = 0 App.getDocument('Unnamed').getObject('Pad').Direction = (1, 1, 1) App.getDocument('Unnamed').getObject('Pad').Type = 0 App.getDocument('Unnamed').getObject('Pad').UpToFace = None App.getDocument('Unnamed').getObject('Pad').Reversed = 0 App.getDocument('Unnamed').getObject('Pad').Midplane = 0 App.getDocument('Unnamed').getObject('Pad').Offset = 0 App.getDocument('Unnamed').recompute() # Gui.getDocument('Unnamed').resetEdit() Gui.runCommand('PartDesign_NewSketch',0) # Gui.Selection.addSelection('Unnamed','Body','Origin.XZ_Plane.') App.getDocument('Unnamed').getObject('Body').newObject('Sketcher::SketchObject','Sketch001') App.getDocument('Unnamed').getObject('Sketch001').Support = (App.getDocument('Unnamed').getObject('XZ_Plane'),['']) App.getDocument('Unnamed').getObject('Sketch001').MapMode = 'FlatFace' App.ActiveDocument.recompute() Gui.getDocument('Unnamed').setEdit(App.getDocument('Unnamed').getObject('Body'),0,'Sketch001.') # ActiveSketch = App.getDocument('Unnamed').getObject('Sketch001') # tv = Show.TempoVis(App.ActiveDocument, tag= ActiveSketch.ViewObject.TypeId) # ActiveSketch.ViewObject.TempoVis = tv # if ActiveSketch.ViewObject.EditingWorkbench: # tv.activateWorkbench(ActiveSketch.ViewObject.EditingWorkbench) # if ActiveSketch.ViewObject.HideDependent: # tv.hide(tv.get_all_dependent(App.getDocument('Unnamed').getObject('Body'), 'Sketch001.')) # if ActiveSketch.ViewObject.ShowSupport: # tv.show([ref[0] for ref in ActiveSketch.Support if not ref[0].isDerivedFrom("PartDesign::Plane")]) # if ActiveSketch.ViewObject.ShowLinks: # tv.show([ref[0] for ref in ActiveSketch.ExternalGeometry]) # tv.hide(ActiveSketch) # del(tv) # # ActiveSketch = App.getDocument('Unnamed').getObject('Sketch001') # if ActiveSketch.ViewObject.RestoreCamera: # ActiveSketch.ViewObject.TempoVis.saveCamera() # # Gui.Selection.clearSelection() # Gui.runCommand('Sketcher_CreateLine',0) App.getDocument('Unnamed').getObject('Sketch001').addGeometry(Part.LineSegment(App.Vector(-60.340603,40.030975,0),App.Vector(60.405796,79.931305,0)),False) App.ActiveDocument.recompute() # Gui.getDocument('Unnamed').resetEdit() App.ActiveDocument.recompute() # ActiveSketch = App.getDocument('Unnamed').getObject('Sketch001') # tv = ActiveSketch.ViewObject.TempoVis # if tv: # tv.restore() # ActiveSketch.ViewObject.TempoVis = None # del(tv) # # Gui.Selection.addSelection('Unnamed','Body','Sketch001.') App.getDocument('Unnamed').recompute() Gui.runCommand('PartDesign_NewSketch',0) # Gui.Selection.clearSelection() # Gui.Selection.addSelection('Unnamed','Body','Origin.YZ_Plane.') App.getDocument('Unnamed').getObject('Body').newObject('Sketcher::SketchObject','Sketch002') App.getDocument('Unnamed').getObject('Sketch002').Support = (App.getDocument('Unnamed').getObject('YZ_Plane'),['']) App.getDocument('Unnamed').getObject('Sketch002').MapMode = 'FlatFace' App.ActiveDocument.recompute() Gui.getDocument('Unnamed').setEdit(App.getDocument('Unnamed').getObject('Body'),0,'Sketch002.') # ActiveSketch = App.getDocument('Unnamed').getObject('Sketch002') # tv = Show.TempoVis(App.ActiveDocument, tag= ActiveSketch.ViewObject.TypeId) # ActiveSketch.ViewObject.TempoVis = tv # if ActiveSketch.ViewObject.EditingWorkbench: # tv.activateWorkbench(ActiveSketch.ViewObject.EditingWorkbench) # if ActiveSketch.ViewObject.HideDependent: # tv.hide(tv.get_all_dependent(App.getDocument('Unnamed').getObject('Body'), 'Sketch002.')) # if ActiveSketch.ViewObject.ShowSupport: # tv.show([ref[0] for ref in ActiveSketch.Support if not ref[0].isDerivedFrom("PartDesign::Plane")]) # if ActiveSketch.ViewObject.ShowLinks: # tv.show([ref[0] for ref in ActiveSketch.ExternalGeometry]) # tv.hide(ActiveSketch) # del(tv) # # ActiveSketch = App.getDocument('Unnamed').getObject('Sketch002') # if ActiveSketch.ViewObject.RestoreCamera: # ActiveSketch.ViewObject.TempoVis.saveCamera() # # Gui.Selection.clearSelection() # Gui.runCommand('Std_DrawStyle',2) # Gui.runCommand('Sketcher_CompCreateCircle',0) App.getDocument('Unnamed').getObject('Sketch002').addGeometry(Part.Circle(App.Vector(-0.106689,85.865601,0),App.Vector(0,0,1),16.255983),False) App.getDocument('Unnamed').getObject('Sketch002').addConstraint(Sketcher.Constraint('PointOnObject',0,3,-2)) App.ActiveDocument.recompute() App.getDocument('Unnamed').getObject('Sketch002').movePoint(0,3,App.Vector(2.489417,60.531879,0),0) App.ActiveDocument.recompute() # Gui.getDocument('Unnamed').resetEdit() App.ActiveDocument.recompute() # ActiveSketch = App.getDocument('Unnamed').getObject('Sketch002') # tv = ActiveSketch.ViewObject.TempoVis # if tv: # tv.restore() # ActiveSketch.ViewObject.TempoVis = None # del(tv) # # Gui.Selection.addSelection('Unnamed','Body','Sketch002.') App.getDocument('Unnamed').recompute() ### Begin command PartDesign_SubtractivePipe App.getDocument('Unnamed').getObject('Body').newObject('PartDesign::SubtractivePipe','SubtractivePipe') App.getDocument('Unnamed').getObject('SubtractivePipe').Profile = App.getDocument('Unnamed').getObject('Sketch002') App.ActiveDocument.recompute() App.getDocument('Unnamed').getObject('Sketch002').Visibility = False App.ActiveDocument.recompute() # App.getDocument('Unnamed').getObject('SubtractivePipe').ViewObject.ShapeColor=getattr(App.getDocument('Unnamed').getObject('Pad').getLinkedObject(True).ViewObject,'ShapeColor',App.getDocument('Unnamed').getObject('SubtractivePipe').ViewObject.ShapeColor) # App.getDocument('Unnamed').getObject('SubtractivePipe').ViewObject.LineColor=getattr(App.getDocument('Unnamed').getObject('Pad').getLinkedObject(True).ViewObject,'LineColor',App.getDocument('Unnamed').getObject('SubtractivePipe').ViewObject.LineColor) # App.getDocument('Unnamed').getObject('SubtractivePipe').ViewObject.PointColor=getattr(App.getDocument('Unnamed').getObject('Pad').getLinkedObject(True).ViewObject,'PointColor',App.getDocument('Unnamed').getObject('SubtractivePipe').ViewObject.PointColor) # App.getDocument('Unnamed').getObject('SubtractivePipe').ViewObject.Transparency=getattr(App.getDocument('Unnamed').getObject('Pad').getLinkedObject(True).ViewObject,'Transparency',App.getDocument('Unnamed').getObject('SubtractivePipe').ViewObject.Transparency) # App.getDocument('Unnamed').getObject('SubtractivePipe').ViewObject.DisplayMode=getattr(App.getDocument('Unnamed').getObject('Pad').getLinkedObject(True).ViewObject,'DisplayMode',App.getDocument('Unnamed').getObject('SubtractivePipe').ViewObject.DisplayMode) Gui.getDocument('Unnamed').setEdit(App.getDocument('Unnamed').getObject('Body'),0,'SubtractivePipe.') # Gui.Selection.clearSelection() ### End command PartDesign_SubtractivePipe # Gui.Selection.clearSelection() # Gui.Selection.addSelection('Unnamed','Body','Sketch001.Edge1',-36.1056,-5.72674e-06,48.0394) # Gui.Selection.clearSelection() App.getDocument('Unnamed').recompute() # Gui.getDocument('Unnamed').resetEdit() # Gui.getDocument('Unnamed').getObject('SubtractivePipe').Visibility = True # Gui.runCommand('Std_DrawStyle',6) ### Begin command Std_ViewFitAll # Gui.SendMsgToActiveView("ViewFit") ### End command Std_ViewFitAll # Macro End: C:\Users\deeja\AppData\Roaming\FreeCAD\Macro\FC_v0.19-22756_Test_SubtractivePipe_org_v2.FCMacro +++++++++++++++++++++++++++++++++++++++++++++++++ |
|
Open discussion forum thread: https://forum.freecadweb.org/viewtopic.php?f=8&t=52968 |
|
https://github.com/wwmayer/FreeCAD/tree/bug4139 |
|
Fix committed to master branch. |
Date Modified | Username | Field | Change |
---|---|---|---|
2019-09-20 18:33 | DeeJayOne | New Issue | |
2019-09-20 18:38 | DeeJayOne | File Added: Test_SubtractivePipe_modified.FCMacro | |
2019-09-20 18:38 | DeeJayOne | File Added: Test_SubtractivePipe_org.FCMacro | |
2019-09-20 18:38 | DeeJayOne | Note Added: 0013666 | |
2019-09-21 09:23 | DeeJayOne | Summary | Macro - SubtractivePipe attached path object issues after macro executed. => v0.18-16131 - Macro - SubtractivePipe attached path object issues after macro executed. |
2019-09-21 09:28 | DeeJayOne | Note Added: 0013670 | |
2019-09-21 09:35 | DeeJayOne | Description Updated | |
2019-09-21 09:35 | DeeJayOne | Additional Information Updated | |
2019-09-21 09:38 | DeeJayOne | Additional Information Updated | |
2019-09-21 09:42 | DeeJayOne | Note Added: 0013671 | |
2020-10-22 22:01 | Kunda1 | Status | new => feedback |
2020-10-22 22:01 | Kunda1 | Note Added: 0014935 | |
2020-10-23 03:05 | Kunda1 | Tag Attached: #pending | |
2020-11-03 18:56 | DeeJayOne | Note Added: 0014962 | |
2020-11-03 18:56 | DeeJayOne | File Added: FC_v0.19-22756_Test_SubtractivePipe_org.FCMacro | |
2020-11-03 18:56 | DeeJayOne | Status | feedback => new |
2020-12-06 17:52 | Kunda1 | Note Added: 0015098 | |
2021-02-06 06:43 | abdullah | Target Version | => 0.20 |
2021-02-20 18:28 | wmayer | Note Added: 0015393 | |
2021-03-29 09:00 | wmayer | Changeset attached | => FreeCAD master 05f16342 |
2021-03-29 09:00 | wmayer | Note Added: 0015572 | |
2021-03-29 09:00 | wmayer | Assigned To | => wmayer |
2021-03-29 09:00 | wmayer | Status | new => closed |
2021-03-29 09:00 | wmayer | Resolution | open => fixed |