Trouble with radial dimension

Trouble with radial dimension

casey.rogers
Alumni Alumni
900 Views
2 Replies
Message 1 of 3

Trouble with radial dimension

casey.rogers
Alumni
Alumni

I have the following code that attempts to create a radial dimension:

 

        offsetB = sketch.sketchDimensions.addRadialDimension(outerCircle, outerC.geometry)
        offsetB.parameter.expression = someExpression

I keep getting an error that offsetB.paramter is a noneType object and has no attribute expression. I am trying to use the radial dimension in the same way I'd use a length dimension, is that incorrect? Why is the parameter a noneType object?

 

0 Likes
Accepted solutions (1)
901 Views
2 Replies
Replies (2)
Message 2 of 3

ekinsb
Alumni
Alumni

I just wrote the simple test below and it's working correctly for me.  I don't see anything obviously different from your code.

 

        des = app.activeProduct
        root = des.rootComponent

        sk = root.sketches.add(root.xYConstructionPlane)        
        
        circles = sk.sketchCurves.sketchCircles
        circle1 = circles.addByCenterRadius(adsk.core.Point3D.create(0, 0, 0), 2)

        dims = sk.sketchDimensions
        radDim = dims.addRadialDimension(circle1, adsk.core.Point3D.create(2.2, 2.2, 0))
        
        radDim.parameter.expression = "4 in"        

Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
Message 3 of 3

casey.rogers
Alumni
Alumni
Accepted solution

Well I tried your test code and it failed as well, I identified the issue: I was working in the direct modeling environment. Capturing design history fixed it.

0 Likes