Community
Hello, kindly ask to help in code for making circle. I want to get a macros, that would create new sketch with project geometry from all existing sketches and would built a circle from a point, that i pick up by cursor. Radius of circle for example is 1 (in really i don't care on this stage, I just need to have method to choose center of this circle). Thank you
See one of the API samples here. The code below is the top half of the macro. I suggest if you need further helps with these sketches that you have a look through the samples. You will be able to identify a nice few methods for different objects.
' Create a new part document, using the default part template. Dim oPartDoc As PartDocument Set oPartDoc = ThisApplication.Documents.Add(kPartDocumentObject, _ ThisApplication.FileManager.GetTemplateFile(kPartDocumentObject)) ' Set a reference to the component definition. Dim oCompDef As PartComponentDefinition Set oCompDef = oPartDoc.ComponentDefinition ' Create a new sketch on the X-Y work plane. Dim oSketch As PlanarSketch Set oSketch = oCompDef.Sketches.Add(oCompDef.WorkPlanes(3)) ' Set a reference to the transient geometry object. Dim oTransGeom As TransientGeometry Set oTransGeom = ThisApplication.TransientGeometry Dim oCenter As Point2d Set oCenter = oTransGeom.CreatePoint2d(-5, 0) ' Create a sketch circle Dim oCircle As SketchCircle Set oCircle = oSketch.SketchCircles.AddByCenterRadius(oCenter, 1)
Can't find what you're looking for? Ask the community or share your knowledge.