PutArcData throws a NotImplementedException

PutArcData throws a NotImplementedException

nannerdw
Advocate Advocate
365 Views
1 Reply
Message 1 of 2

PutArcData throws a NotImplementedException

nannerdw
Advocate
Advocate

 

I also tested PutVectorData, and it works as expected.

 

I'm able to work around this by creating a new Arc3d each time the Radius, StartAngle, or SweepAngle changes.

Is there a better way to do this?  I'm not very familiar with TransientGeometry yet.

 

iLogic Code:

Imports System.Text 'for StringBuilder

Dim results As StringBuilder = New StringBuilder

Dim tg as TransientGeometry = ThisApplication.TransientGeometry

Dim vec1 As Vector = tg.createVector(1,1,1)

Dim arc1 As Arc3d = tg.CreateArc3d( _
    Center:= tg.CreatePoint(0,0,0), _
    Normal:= tg.CreateUnitVector(0,0,1), _
    ReferenceVector:=tg.CreateUnitVector(1,0,0), _
    Radius:= 1, _
    StartAngle:=0, _
    SweepAngle:=PI)
    

'----------------------
'PutVectorData Succeeds
'----------------------
Try
    vec1.PutVectorData(coords:={1,1,2})
    
    results.AppendLine("vec1.PutVectorData Succeeded" & vbNewLine)
    
Catch ex As Exception
    results.AppendLine("vec1.PutVectorData threw " & TypeName(ex) & vbNewLine)
End Try


'------------------------------------------------
'arc1.PutArcData throws a NotImplementedException
'------------------------------------------------
Try
    arc1.PutArcData( _
        Center:= {1,1,1}, _
        AxisVector:= {0,0,1}, _
        RefVector:={1,0,0}, _
        Radius:= 1, _
        StartAngle:=0, _
        SweepAngle:=PI)
        
    results.AppendLine("arc1.PutArcData Succeeded")
        
Catch ex As Exception
    results.AppendLine("arc1.PutArcData threw " & TypeName(ex) & vbNewLine)
End Try


'---------------------------------
'arc1.Center.PutPointData Succeeds
'---------------------------------
Try
    arc1.Center.PutPointData({1,1,1})
        
    results.AppendLine("arc1.Center.PutPointData Succeeded" & vbNewLine)
        
Catch ex As Exception
    results.AppendLine("arc1.Center.PutPointData threw " & TypeName(ex) & vbNewLine)
End Try


'--------------------------------------
'arc1.Normal.PutUnitVectorData Succeeds
'--------------------------------------
Try
    arc1.Normal.PutUnitVectorData({0,1,0})
    arc1.Normal.PutUnitVectorData({0,0,1})
        
    results.AppendLine("arc1.Normal.PutUnitVectorData Succeeded" & vbNewLine)
        
Catch ex As Exception
    results.AppendLine("arc1.Normal.PutUnitVectorData threw " & TypeName(ex) & vbNewLine)
End Try


'-----------------------------------------------
'arc1.ReferenceVector.PutUnitVectorData Succeeds
'-----------------------------------------------
Try
    arc1.ReferenceVector.PutUnitVectorData({0,1,0})
    arc1.ReferenceVector.PutUnitVectorData({1,0,0})
        
    results.AppendLine("arc1.ReferenceVector.PutUnitVectorData Succeeded" & vbNewLine)
        
Catch ex As Exception
    results.AppendLine("arc1.ReferenceVector.PutUnitVectorData threw " & TypeName(ex) & vbNewLine)
End Try


'--------------------------------------------
'arc1.Radius throws a NotImplementedException
'--------------------------------------------
Try
    arc1.Radius = 2
        
    results.AppendLine("arc1.Radius Succeeded" & vbNewLine)
        
Catch ex As Exception
    results.AppendLine("arc1.Radius threw " & TypeName(ex) & vbNewLine)
End Try


'------------------------------------------------
'arc1.StartAngle throws a NotImplementedException
'------------------------------------------------
Try
    arc1.StartAngle = PI/4
        
    results.AppendLine("arc1.StartAngle Succeeded" & vbNewLine)
        
Catch ex As Exception
    results.AppendLine("arc1.StartAngle threw " & TypeName(ex) & vbNewLine)
End Try


'------------------------------------------------
'arc1.SweepAngle throws a NotImplementedException
'------------------------------------------------
Try
    arc1.SweepAngle = PI/2
        
    results.AppendLine("arc1.SweepAngle Succeeded" & vbNewLine)
        
Catch ex As Exception
    results.AppendLine("arc1.SweepAngle threw " & TypeName(ex) & vbNewLine)
End Try


MessageBox.Show(results.ToString, "Test Results")

 

Tested with Inventor 2016 and 2018 in Windows 10.

0 Likes
Accepted solutions (1)
366 Views
1 Reply
Reply (1)
Message 2 of 2

BrianEkins
Mentor
Mentor
Accepted solution

You're right.  It's likely this code was never completed.  But it is also very rarely used because this has been a part of the API since almost the beginning of the API and you might be the first person to notice it.  It also fails when I try to set the individual properties on the arc.  The simple workaround is to just create a new Arc3D object instead of modifying the existing one.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes