Message 1 of 2

Not applicable
08-10-2020
07:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Currently I have some simple code to create a sketch and draw a circle. I have a UserParameter called ConduitRadius that I want to use to control the radius of my circle, but I can't find a way to set the radius to the parameter instead of just it's value. The .Radius/AddByCenterRadius only accepts a Double, so I can't use "ConduitRadius". I tried to create a DimensionConstraint, but there doesn't seem to be a way to change the parameter. It seems like this should be simple, but I can't find any answers.
Dim oDoc As Document = ThisDoc.Document Dim oDef As ComponentDefinition = oDoc.ComponentDefinition Dim StartPlane As WorkPlane = oDef.workplanes.item("StartPlane") Dim StartPoint As WorkPoint = oDef.workpoints.item("StartPoint") Dim PointProxy As Point2d = ThisApplication.TransientGeometry.CreatePoint2d() Dim StartSketch As PlanarSketch = oDef.sketches.add(StartPlane) StartSketch.Name = "StartSketch" Dim PointEntity As SketchPoint = StartSketch.AddByProjectingEntity(StartPoint) Dim Circle As SketchCircle = StartSketch.SketchCircles.AddByCenterRadius(PointEntity, ConduitRadius) 'Circle.Radius = "ConduitRadius" 'Dim oRadius As RadiusDimConstraint = StartSketch.DimensionConstraints.AddRadius(Circle, PointProxy) 'oRadius.Parameter = "ConduitRadius"
Solved! Go to Solution.