Can you share the macro file and not a screenshot ?
and try to add :
Dim SwmodelDocExt as Sldwork.ModelDocExtensionSet SwmodelDocExt = Part.ExtensionBoolstatus = SwmodelDocExt.SelectByID2( blablabla ....)
thak you. i tried this
ISMAEL DIAKITE wrote: thak you. i tried this
ISMAEL DIAKITE wrote:
Attach your complete macro (swp) file and also a part file to check/test.
Make sure your model has the plane with exact name as Front Plane.
that's it, he's certainly using a French SolidWorks (comment in the code are in French) so he should change "Font Plane" to "Plan de face"
when i finish the code it works well, but as soon as i close and reopen solidworks it shows me the same error. I don't know how to download the code, I'll copy it to you. thank you.
Dim swApp As SldWorks.SldWorks ' Declaration des variables
Dim Part As SldWorks.ModelDoc2Dim boolstatus As BooleanDim longstatus As Long, longwarnings As LongDim skSegment As SldWorks.SketchSegmentDim myFeature As ObjectDim D As DoubleDim L As Double
Private Sub cmd_end_Click() EndEnd Sub
Private Sub cmd_ok_Click()
Set swApp = Application.SldWorks ' F5 exécutionSet swModel = swApp.ActiveDocSet Part = swApp.ActiveDoc ' F8 exécution pas a pas
D = CDbl(txt_D.Value)L = CDbl(txt_L.Value)
boolstatus = Part.Extension.SelectByID2("Front Plane", "PLANE", 0, 0, 0, False, 0, Nothing, 0)Part.SketchManager.InsertSketch True'Part.ClearSelection2 True
Set skSegment = Part.SketchManager.CreateCircleByRadius(0, 0, 0, D) ' en mètre et en radian
' Named View'Part.ShowNamedView2 "*Trimetric", 8'Part.ViewZoomtofit2
Set myFeature = Part.FeatureManager.FeatureExtrusion2(True, False, False, 0, 0, L, 0.01, False, False, False, False, 1.74532925199433E-02, 1.74532925199433E-02, False, False, False, False, True, True, True, 0, 0, False)'Part.SelectionManager.EnableContourSelection = False
ISMAEL DIAKITE wrote: I don't know how to download the code, I'll copy it to you. thank you.
I don't know how to download the code, I'll copy it to you. thank you.
How can I attach a file to a forum post?
thank you guy,thanks guys, i actually solved the problem, i was using the wrong path to open my macro. and it didn't work, now it works.
Retrieving data ...