News:

When posting a problem be sure to include which version you are using.  Give as much information as possible.  If the problem is with a specific file be sure to attache it to your post.

Main Menu

TurboCAD 2026 Platinum, Elliptic Arc

Started by Kees Roos, October 04, 2026, 06:51:02 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Kees Roos

Hi all,
I have been away for a while from TurboCAD, had some other projects to attend to.
Now I am back again and I encounter a problem with elliptic arcs.

When I initiate an elliptic arc, I can edit the centerpoint coordinates and the axes magnitudes.
However, when I try to edit the start- and end angles, I have a problem:
When I set the start angle to 0.2 radians and hit Enter, the value is instantly changed
to 0.2904801608r.
After that, when I set the end angle to 1.8 radians, this value changes to 1.7277003593r,
but surprisingly, the start angle simultaniously changes to 0.41521002339r.

Actually I use the Graphic.AddArcRotatedElliptical() Method from the SDK, which has the same results.

I had this working correctly in TurboCAD 2024, but in TurboCAD 2026 I get this result.
I thinks it's a bug .

Anybody has experience with this problem, and if so, has a workaround?
TurboCAD 2026 Platinum
Windows11
Intel(R) Core(TM) Ultra 9 285K, RAM 128GB,
Eizo 31"

Jeff_in_90620

I seeing similar results (although different numbers).

Puzzling.

I tried adjusting the Drawing Setup / Angle to increase Precision, but that didn't help.  Neither did changing Precision in Space Units.

I switched to Degrees, but got the same sort of mangled numbers.
Jeff

TC 2026 Pro Platinum plus 2015->2024 (most with LightWorks & RedSDK) & V21
System: AMD Ryzen 9 7950X, MSI Mag X670E Tomahawk WiFi, 64GB RAM @ 4.80GHz, ARC A770 w/16GB, 3 x Samsung NVMe 990 (1TB), Windows 11 Pro (64-bit)

Alvin Gregorio

#2
It sounds like in v2026, the Inspector Bar Start and End angle fields are dynamically showing the results of the underlying math.
In v2024, we don't see the result of that math until we select the elliptical arc and view the Start and Finish angle in the Selection Info palette.

Perhaps this was intentional by the developers, for v2026.  Or perhaps they inadvertently caused this.
Maybe the developers have since caught this and reverted it back to how it was.
Curious-- Are either of you using v2026.1?
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Kees Roos

Hi Alvin, thanks for your reaction.
No doubt there is some underlying math shown.
However, the result of that math is also visible as a modification of the shown arc, to the values calculated by that math, not to the entered values.
In version 2024, the values in the dialog showed the entered values, and so did the shown arc.

I have entered a question about this to the IMSI service desk. Hopefully they will react soon. Will report here if they do.
TurboCAD 2026 Platinum
Windows11
Intel(R) Core(TM) Ultra 9 285K, RAM 128GB,
Eizo 31"

Alvin Gregorio

#4
Quote from: Kees Roos on October 09, 2026, 10:49:01 AMIn version 2024, the values in the dialog showed the entered values, and so did the shown arc.
Not for me in v2024.
For me, in v2024
"the result of that math is also visible as a modification of the shown arc, to the values calculated by that math, not to the entered values." 
 Example attached.  [EDIT 1:  In the attached image the line that is indicated as "geometric angle" is actually the "parametric (eccentric) angle"]
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Andy H

That would have confused me also. I would have expected the selection palette to report the same figures I had used. 

Alvin Gregorio

Quote from: Andy H on October 09, 2026, 01:32:51 PMThat would have confused me also. I would have expected the selection palette to report the same figures I had used. 
Andy— In TC version(s) 2026 (and/or 2026.1) do you also get the Start and End angles dynamically changing in the Inspector Bar fields as you are inserting the Elliptical Arc and manually entering values in those fields?  (other than orthogonal angles— the parametric angle and true geometric angle remain the same for orthogonal angles)
  Do you think it's a bug?  An intentional new dynamic by the developers?  Or?
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Andy H

Quote from: Alvin Gregorio on October 09, 2026, 02:05:10 PMAndy— In TC version(s) 2026 (and/or 2026.1) do you also get the Start and End angles dynamically changing in the Inspector Bar fields as you are inserting the Elliptical Arc and manually entering values in those fields?  (other than orthogonal angles— the parametric angle and true geometric angle remain the same for orthogonal angles)
  Do you think it's a bug?  An intentional new dynamic by the developers?  Or?

The figures as I enter them stay just the same. The only difference I see, is, as you pointed out. The figures in the selection palette, don't match what one entered in the inspection bar.

I'm running TC 2026 Platinum, version 33, build 65.1.  If the OP is using the same version, I'd have to say not a bug, just confusing for anyone (like me) who didn't know the maths stuff you pointed out.

 

nikkipollard

#8
Are you sure ellipses haven't always worked like this in Turbocad?

This is the formula I use to find the parametric angle when I know the angle to the point on the ellipse (theta)

parameterAngle = abs(atan((MajorRadius * Tan(theta)) / MinorRadius))
you will need to adjust the answer according to the quadrant you are in
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Alvin Gregorio

#9
The main difference/issue that Kees Roos is describing is that the during insertion of the Elliptical Arc, the Start_angle and End_angle fields are dynamically displaying the true geometric angle [EDIT 1: "parametric angle") value during the insertion.
  Andy, using 2026, said he doesn't see it.  Maybe Kees Roos (and Jeff, as he says he experiences the same) need to update their version-2026.
  I thought maybe the issue was due to working in the LTE Workspace perhaps.  But I tested that theory in my v2024, and it did not replicate.

I'd like to see a video of this occurring— from Kees Roos or Jeff.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Alvin Gregorio

Quote from: nikkipollard on October 10, 2026, 02:34:05 AMThis is the formula I use to find the parametric angle when I know the angle to the point on the ellipse (theta)

parameterAngle = abs(atan((MajorRadius * Tan(theta)) / MinorRadius))
you will need to adjust the answer according to the quadrant you are in
Advanced stuff.
  I assume you mean the formula you use in scripts, Nikki.  Is that in PPM scripts?  And/or VB script for use via MacroRecorder?
  I'd be interested in experimenting with a small example.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Kees Roos

Quote from: nikkipollard on October 10, 2026, 02:34:05 AMAre you sure ellipses haven't always worked like this in Turbocad?

This is the formula I use to find the parametric angle when I know the angle to the point on the ellipse (theta)

parameterAngle = abs(atan((MajorRadius * Tan(theta)) / MinorRadius))
you will need to adjust the answer according to the quadrant you are in


Hi Nikki,
Nice to see you are still active, we had some contacts re add property some years ago.

I know the maths.
Problem is: I draw an ellips, and indicate its Start and end. Then hje values showed in the properties-window correspond to the actual shown arc. So far so good.
Subsequently, when I edit the start angle to value 0.2r, The property angle tells me: "So, let's make the value 0.2904801608r, and shows that angle in the properties window, and also in the drawn arc, not the value I entered.
After that, when I enter the end angle 1.8, The properties window shows 1.7277003593r instead of 1.8 and so does the shown arc. On top of that the properties window alters the start angle to 0.41521002339r, and shows that in the arc.
So, I enter parameters start: 0.2, end 1.8 end, and the shown arc starts at 0.41521002339r,  and ends at 1.7277003593r, not 02r and 1.8r.
I think it is a bug.
TurboCAD 2026 Platinum
Windows11
Intel(R) Core(TM) Ultra 9 285K, RAM 128GB,
Eizo 31"

Alvin Gregorio

Quote from: Kees Roos on October 10, 2026, 11:09:02 AMI think it is a bug.
Can you create and upload/attach a screen-capture video of this occurring, Kees.
If TurboCAD support does elect to take this on, they will likely also request a video.  So might as well knock one up now and share with us for diagnosis, in the case TC customer service doesn't come back with any interest.

Reading the way you are now describing, and the way you first described it, it is not clear what you are stating the issue to be.  A video would help clear that up.
  Thanks, Alvin
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Alvin Gregorio

Quote from: Kees Roos on October 09, 2026, 10:49:01 AMIn version 2024, the values in the dialog showed the entered values, and so did the shown arc.
Can you test that out in v2024 again.
Ensuring you are using an Elliptical Arc (not a regular Arc).
Please let us know whether or not what you are describing as the issue you are having in v2026 is or is not assuredly occurring in v2024 also.
Thanks, Alvin

(a video of you doing the above would be great— useful)
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

nikkipollard

#14
I don't have the newer version of TC but my old 2021 version will convert the angle typed into the Selection info palette to the parametric angle.
As shown in Alvins drawing and the equation.
Does the arc look correct when you change the angle?
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Alvin Gregorio

#15
Quote from: Kees Roos on October 10, 2026, 11:09:02 AMSubsequently, when I edit the start angle to value 0.2r, The property angle tells me: "So, let's make the value 0.2904801608r, and shows that angle in the properties window, and also in the drawn arc, not the value I entered.
After that, when I enter the end angle 1.8, The properties window shows 1.7277003593r instead of 1.8 and so does the shown arc. On top of that the properties window alters the start angle to 0.41521002339r, and shows that in the arc.
So, I enter parameters start: 0.2, end 1.8 end, and the shown arc starts at 0.41521002339r,  and ends at 1.7277003593r, not 02r and 1.8r.
I think it is a bug.
I think I am discovering what you are describing, Kees Roos.
What is the desired Major Radius and Minor Radius of the Elliptical Arc you are referencing above?


Quote from: Kees Roos on October 04, 2026, 06:51:02 AMAnybody has experience with this problem, and if so, has a workaround?
In Selection Info palette, first set the smaller of the Major and Minor radius to be the same as that of the larger.  Then enter your desired parametric angles for Start and Finish angles, such as 0.2 and 1.8 in your example.  Then go back and set what was the smaller of the Major and Minor radius back to the original value you set.
  After hitting the last Enter, the Start and Finish angles will revert to their true geometric [EDIT 1: parametric] angle value.  But that's okay; they are correct.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

nikkipollard

#16
Quote from: Alvin Gregorio on October 11, 2026, 11:31:37 AM
Quote from: Kees Roos on October 10, 2026, 11:09:02 AMSubsequently, when I edit the start angle to value 0.2r, The property angle tells me: "So, let's make the value 0.2904801608r, and shows that angle in the properties window, and also in the drawn arc, not the value I entered.
After that, when I enter the end angle 1.8, The properties window shows 1.7277003593r instead of 1.8 and so does the shown arc. On top of that the properties window alters the start angle to 0.41521002339r, and shows that in the arc.
So, I enter parameters start: 0.2, end 1.8 end, and the shown arc starts at 0.41521002339r,  and ends at 1.7277003593r, not 02r and 1.8r.
I think it is a bug.
I think I am discovering what you are describing, Kees Roos.
What is the desired Major Radius and Minor Radius of the Elliptical Arc you are referencing above?


Quote from: Kees Roos on October 04, 2026, 06:51:02 AMAnybody has experience with this problem, and if so, has a workaround?
In Selection Info palette, first set the smaller of the Major and Minor radius to be the same as that of the larger.  Then enter your desired parametric angles for Start and Finish angles, such as 0.2 and 1.8 in your example.  Then go back and set what was the smaller of the Major and Minor radius back to the original value you set.
  After hitting the last Enter, the Start and Finish angles will revert to their true geometric angle value.  But that's okay; they are correct.

Alvin I think the Parameter angle is the angle you are calling the geometric angle. It is called that because it is the angle used to calculate the co ordinates on the ellipse.

In a dxf file, the start angle (Group 41) and end angle (Group 42) refer to the parameter angle. I am pretty sure that Turbocad follows the same logic when reading an elliptical arc.
You could try running this to see if it is a bug or not.
It seems to work in TC 2021

Option Explicit
                                                         
'====================================================================
   '# DESCRIPTION
'** Elliptical Arc Test
'=====================================================================
Call Main
'_______________________________________________________________________________
Sub Main
     
Dim SA, EA, SAP,EAP, MJ, MN
Dim PStartX,PStarty,PEndX,PEndY
Const PI = 3.1415926535897932384626433832795
SA = 25                  'Start Angle from Major axis in Degrees
EA =250                  'End Angle from Major axis in Degrees
MJ = 250                 ' Major Axis
MN = 200                 'Minor axis


IF SA <0 Then SA = SA+360
IF EA <0 Then EA = EA+360
SAP = SA/180 * PI
EAP = EA/180 * PI

'Parameter angles
'abs(atan((MajorRadius * Tan(theta)) / MinorRadius))
SAP = abs(atn((MJ*Tan(SAP))/MN))
EAP = abs(atn((MJ*Tan(EAP))/MN))


Select Case True
 Case InRange(SA,0,90)
  SAP = SAP
 Case InRange(SA,90,180)
 SAP = PI - SAP
 Case InRange(SA,180,270)
 SAP = PI + SAP
 Case else
 SAP = PI*2 - SAP
 End Select

Select Case True
 Case InRange(EA,0,90)
  EAP = EAP
 Case InRange(EA,90,180)
 EAP = PI - EAP
 Case InRange(EA,180,270)
 EAP = PI + EAP
 Case else
 EAP = 2*PI - EAP

End Select

Call ActiveDrawing.Graphics.AddLineSingle(-MJ,0,0,MJ,0,0)
Call ActiveDrawing.Graphics.AddLineSingle(0,-MN,0,0,MN,0)

PStartX = MJ*cos(SAP)
PStartY = MN*sin(SAP)
PEndX = MJ*cos(EAP)
PEndY = MN*sin(EAP)

Call ActiveDrawing.Graphics.AddLineSingle(PStartX,PStarty,0,0,0,0)
Call ActiveDrawing.Graphics.AddLineSingle(PEndX,PEndY,0,0,0,0)

'###Graphics.AddArcRotatedElliptical(CentreX,CentreY,CentreZ,MajorX,MajorY,MajorZ,MinorX,MinorY,MinorZ,Radians(SA),Radians(EA))
Call ActiveDrawing.Graphics.AddArcRotatedElliptical(0,0,0,MJ,0,0,0,MN,0,Radians(SA),Radians(EA))
Dim SAString,EAString

SAString = "Start Angle (parameter angle) = " & SAP * 180 / PI
EAString = "End Angle (parameter angle)= " & EAP * 180 / PI
Call ActiveDrawing.Graphics.AddText(SAString,0,0,0,10)
Call ActiveDrawing.Graphics.AddText(EAString,0,-15,0,10)
 
 'convert back to geometric angles (angles on ellipse)
 '//  atan((MinorRadius * Tan(omega)) / MajorRadius)
 SAP = abs(atn((MN * tan(SAP))/MJ))
 EAP = abs(atn((MN * tan(EAP))/MJ))

Select Case True
 Case InRange(SA,0,90)
  SAP = SAP
 Case InRange(SA,90,180)
 SAP = PI - SAP
 Case InRange(SA,180,270)
 SAP = PI + SAP
 Case else
 SAP = PI*2 - SAP
 End Select

Select Case True
 Case InRange(EA,0,90)
  EAP = EAP
 Case InRange(EA,90,180)
 EAP = PI - EAP
 Case InRange(EA,180,270)
 EAP = PI + EAP
 Case else
 EAP = 2*PI - EAP

End Select



 SAString = "Start Angle (geometric angle) = " & SAP * 180 / PI
EAString = "End Angle (geometric angle)= " & EAP * 180 / PI
 Call ActiveDrawing.Graphics.AddText(SAString,0,-30,0,10)
Call ActiveDrawing.Graphics.AddText(EAString,0,-45,0,10)
 
 ActiveDrawing.ActiveView.Refresh

End Sub

'________________________________________________________________________________
Function InRange(val, min1, max1)
  dim mi,ma
  mi = Min(min1,max1)
  ma = Max(min1,max1)
  InRange = val >= mi And val <= ma
End Function

Function Radians(Degrees)
 Dim pi
pi = 3.1415926535897932384626433832795
 Radians = Degrees * pi / 180
  End Function
 
  Function Min(x1 ,x2)
 If x1 > x2 Then
  Min = x2
 Else
   Min = x1
 End If
 End Function
 
 Function Max(x1 , x2)
 If x1<x2 Then
  Max=x2
 Else
   Max = x1
 End If
 End Function

Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Alvin Gregorio

Quote from: nikkipollard on October 11, 2026, 08:58:15 PMAlvin I think the Parameter angle is the angle you are calling the geometric angle.
I think you are right, Nikki.   I'll go back and edit my posts for clarity.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Alvin Gregorio

#18
Quote from: nikkipollard on October 11, 2026, 08:58:15 PMYou could try running this
Yep.  Works good.  Good job on this, Nikki.  Cool stuff.
  We'd need video from Kees Roos from their v2026 and v2024 to show what they deem the issue or bug to be and how it isn't so in v2024.  (my hunch is that it behaves the same in all TC versions)


The next development of your script would incorporate a fields box so that the user could enter Major & Minor radii (or ellipse box width and height) and desired geometric Start and End angles.  I think I could add it; it'd be a good scripting exercise.

I wonder if you could create a script that allows a user to select a previously inserted elliptical arc and directly change one or both of the Start and End angles to a different desired geometric angle.  And have the elliptical arc correctly modify.

Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

nikkipollard

Quote from: Alvin Gregorio on October 12, 2026, 06:09:06 AM
Quote from: nikkipollard on October 11, 2026, 08:58:15 PMYou could try running this
Yep.  Works good.  Good job on this, Nikki.  Cool stuff.
  We'd need video from Kees Roos from their v2026 and v2024 to show what they deem the issue or bug to be and how it isn't so in v2024.  (my hunch is that it behaves the same in all TC versions)


The next development of your script would incorporate a fields box so that the user could enter Major & Minor radii (or ellipse box width and height) and desired geometric Start and End angles.  I think I could add it; it'd be a good scripting exercise.

I wonder if you could create a script that allows a user to select a previously inserted elliptical arc and directly change one or both of the Start and End angles to a different desired geometric angle.  And have the elliptical arc correctly modify.



You can
The fancy GUI for this little script can be your project. The method I use involves .exe files which you can't share on the forum.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Alvin Gregorio

Quote from: nikkipollard on October 12, 2026, 10:15:11 PMThe fancy GUI for this little script can be your project
Google Gemini AI generated, with my prompts:
Option Explicit
                                                        
'====================================================================
   '# DESCRIPTION
'** Elliptical Arc Test - With User Prompts
'=====================================================================
Call Main
'_______________________________________________________________________________
Sub Main
    
Dim SA, EA, SAP,EAP, MJ, MN
Dim PStartX,PStarty,PEndX,PEndY
Const PI = 3.1415926535897932384626433832795

' Prompt user for inputs and convert to Double (decimal) numbers
MJ = CDbl(InputBox("Enter Major Radius:", "Elliptical Arc Parameters", "250"))
MN = CDbl(InputBox("Enter Minor Radius:", "Elliptical Arc Parameters", "200"))
SA = CDbl(InputBox("Enter Start Angle (Geometric Degrees):", "Elliptical Arc Parameters", "25"))
EA = CDbl(InputBox("Enter End Angle (Geometric Degrees):", "Elliptical Arc Parameters", "250"))

IF SA <0 Then SA = SA+360
IF EA <0 Then EA = EA+360
SAP = SA/180 * PI
EAP = EA/180 * PI

'Parameter angles
'abs(atan((MajorRadius * Tan(theta)) / MinorRadius))
SAP = abs(atn((MJ*Tan(SAP))/MN))
EAP = abs(atn((MJ*Tan(EAP))/MN))

Select Case True
 Case InRange(SA,0,90)
  SAP = SAP
 Case InRange(SA,90,180)
 SAP = PI - SAP
 Case InRange(SA,180,270)
 SAP = PI + SAP
 Case else
 SAP = PI*2 - SAP
 End Select

Select Case True
 Case InRange(EA,0,90)
  EAP = EAP
 Case InRange(EA,90,180)
 EAP = PI - EAP
 Case InRange(EA,180,270)
 EAP = PI + EAP
 Case else
 EAP = 2*PI - EAP

End Select

Call ActiveDrawing.Graphics.AddLineSingle(-MJ,0,0,MJ,0,0)
Call ActiveDrawing.Graphics.AddLineSingle(0,-MN,0,0,MN,0)

PStartX = MJ*cos(SAP)
PStartY = MN*sin(SAP)
PEndX = MJ*cos(EAP)
PEndY = MN*sin(EAP)

Call ActiveDrawing.Graphics.AddLineSingle(PStartX,PStarty,0,0,0,0)
Call ActiveDrawing.Graphics.AddLineSingle(PEndX,PEndY,0,0,0,0)

'###Graphics.AddArcRotatedElliptical(CentreX,CentreY,CentreZ,MajorX,MajorY,MajorZ,MinorX,MinorY,MinorZ,Radians(SA),Radians(EA))
Call ActiveDrawing.Graphics.AddArcRotatedElliptical(0,0,0,MJ,0,0,0,MN,0,Radians(SA),Radians(EA))
Dim SAString,EAString

SAString = "Start Angle (parameter angle) = " & SAP * 180 / PI
EAString = "End Angle (parameter angle)= " & EAP * 180 / PI
Call ActiveDrawing.Graphics.AddText(SAString,0,0,0,10)
Call ActiveDrawing.Graphics.AddText(EAString,0,-15,0,10)
 
 'convert back to geometric angles (angles on ellipse)
 '//  atan((MinorRadius * Tan(omega)) / MajorRadius)
 SAP = abs(atn((MN * tan(SAP))/MJ))
 EAP = abs(atn((MN * tan(EAP))/MJ))

Select Case True
 Case InRange(SA,0,90)
  SAP = SAP
 Case InRange(SA,90,180)
 SAP = PI - SAP
 Case InRange(SA,180,270)
 SAP = PI + SAP
 Case else
 SAP = PI*2 - SAP
 End Select

Select Case True
 Case InRange(EA,0,90)
  EAP = EAP
 Case InRange(EA,90,180)
 EAP = PI - EAP
 Case InRange(EA,180,270)
 EAP = PI + EAP
 Case else
 EAP = 2*PI - EAP

End Select

 SAString = "Start Angle (geometric angle) = " & SAP * 180 / PI
 EAString = "End Angle (geometric angle)= " & EAP * 180 / PI
 Call ActiveDrawing.Graphics.AddText(SAString,0,-30,0,10)
 Call ActiveDrawing.Graphics.AddText(EAString,0,-45,0,10)
 
 ActiveDrawing.ActiveView.Refresh

End Sub

'________________________________________________________________________________
Function InRange(val, min1, max1)
  dim mi,ma
  mi = Min(min1,max1)
  ma = Max(min1,max1)
  InRange = val >= mi And val <= ma
End Function

Function Radians(Degrees)
 Dim pi
 pi = 3.1415926535897932384626433832795
 Radians = Degrees * pi / 180
End Function
 
Function Min(x1 ,x2)
 If x1 > x2 Then
  Min = x2
 Else
   Min = x1
 End If
End Function
 
Function Max(x1 , x2)
 If x1<x2 Then
  Max=x2
 Else
   Max = x1
 End If
End Function

If using the attached .tcr file in TC MacroRecorder, delete the .txt extension after downloading (and saving somewhere you remember).


This one allows to edit the Start and End angles of an already-inserted Elliptical Arc that the user currently has selected via entering geometric angles (the typical user-desired angles).  After completing the last prompted entry, hit Escape or click outside of the current selection to get it to execute.
  Needs some work.  Could use and Undo_Record, and could use not having to hit Escape or click off the selection to get it to execute.
  It converts to Degrees.  Could probably add a Radians option (or maybe read the drawing's Angle Units setting).
The workaround I offered a few posts ago is faster and less cumbersome.

Both this one and the one above runs in TC's MacroRecorder.  One can Copy/Paste the code text into TC MC.
' ==============================================================================
' TurboCAD Macro: Set Elliptical Arc Angles (Geometric to Parametric) V3
' ==============================================================================

Sub UpdateEllipticalArcAngles()
    Dim app, draw, sel, arc
    Dim majorRad, minorRad
    Dim geoStartStr, geoEndStr
    Dim geoStart, geoEnd
    Dim paramStartRads, paramEndRads
    Dim pi
    pi = 4 * Atn(1)
   
    ' 1. Connect to TurboCAD
    On Error Resume Next
    Set app = GetObject(, "TurboCAD.Application")
    If Err.Number <> 0 Then
        MsgBox "Could not connect to TurboCAD. Ensure it is running.", vbCritical, "Error"
        Exit Sub
    End If
    On Error GoTo 0
   
    Set draw = app.ActiveDrawing
    Set sel = draw.Selection
   
    ' 2. Validate Selection
    If sel.Count <> 1 Then
        MsgBox "Please select exactly ONE elliptical arc.", vbExclamation, "Selection Error"
        Exit Sub
    End If
    Set arc = sel.Item(0)
   
    ' 3. Read Radii using the exact internal 'M_' property names
    majorRad = ReadProperty(arc, "M_MajorRadius")
    minorRad = ReadProperty(arc, "M_MinorRadius")
   
    If IsEmpty(majorRad) Or IsEmpty(minorRad) Then
        MsgBox "Could not read M_MajorRadius or M_MinorRadius. Is the object an Elliptical Arc?", vbCritical, "Property Error"
        Exit Sub
    End If
   
    ' 4. Prompt User for Desired Geometric Angles (in Degrees)
    geoStartStr = InputBox("Enter desired Geometric START Angle (in degrees):", "Set Start Angle", "0")
    If Trim(geoStartStr) = "" Then Exit Sub
   
    geoEndStr = InputBox("Enter desired Geometric END Angle (in degrees):", "Set End Angle", "90")
    If Trim(geoEndStr) = "" Then Exit Sub
   
    ' Validate numeric input
    On Error Resume Next
    geoStart = CDbl(geoStartStr)
    geoEnd = CDbl(geoEndStr)
    If Err.Number <> 0 Then
        MsgBox "Invalid angle entered. Numeric values only.", vbCritical, "Input Error"
        Exit Sub
    End If
    On Error GoTo 0
   
    ' 5. Calculate Parametric Angles in Radians
    paramStartRads = GeoToParametricRads(geoStart, majorRad, minorRad)
    paramEndRads = GeoToParametricRads(geoEnd, majorRad, minorRad)
   
    ' 6. Apply the new angles directly to the internal properties
    Dim startSuccess, endSuccess
    startSuccess = WriteProperty(arc, "M_StartAngle", paramStartRads)
    endSuccess = WriteProperty(arc, "M_FinishAngle", paramEndRads)
   
    If Not startSuccess Or Not endSuccess Then
        MsgBox "Failed to write new angles. The 'M_' metrics might be locked as read-only in this TurboCAD version.", vbCritical, "Write Error"
        Exit Sub
    End If
   
    ' Convert Rads back to Degrees for the success message display
    Dim pStartDeg, pEndDeg
    pStartDeg = paramStartRads * 180.0 / pi
    pEndDeg = paramEndRads * 180.0 / pi
   
    MsgBox "Angles applied successfully!" & vbCrLf & vbCrLf & _
           "Geometric Start: " & geoStart & "°  ->  Parametric: " & Round(pStartDeg, 3) & "°" & vbCrLf & _
           "Geometric End: " & geoEnd & "°  ->  Parametric: " & Round(pEndDeg, 3) & "°", vbInformation, "Success"
End Sub

' ------------------------------------------------------------------------------
' Helper: Safely Read from TC Properties Collection
' ------------------------------------------------------------------------------
Function ReadProperty(obj, propName)
    On Error Resume Next
    ReadProperty = obj.Properties(propName).Value
    If Err.Number <> 0 Then ReadProperty = Empty
    On Error GoTo 0
End Function

' ------------------------------------------------------------------------------
' Helper: Safely Write to TC Properties Collection
' ------------------------------------------------------------------------------
Function WriteProperty(obj, propName, val)
    On Error Resume Next
    obj.Properties(propName).Value = val
    If Err.Number = 0 Then
        WriteProperty = True
    Else
        WriteProperty = False
    End If
    On Error GoTo 0
End Function

' ------------------------------------------------------------------------------
' Helper Function: Converts Geometric Degrees directly to Parametric Radians
' ------------------------------------------------------------------------------
Function GeoToParametricRads(geoDeg, a, b)
    Dim pi, radGeo, Y, X, radParam
    pi = 4 * Atn(1)
   
    ' Convert input degrees to radians
    radGeo = geoDeg * pi / 180.0
   
    ' Calculate proportionate X and Y
    Y = a * Sin(radGeo)
    X = b * Cos(radGeo)
   
    ' ATan2 implementation for VBScript
    If X > 0 Then
        radParam = Atn(Y / X)
    ElseIf X < 0 Then
        radParam = Atn(Y / X) + pi
    Else ' X = 0
        If Y > 0 Then
            radParam = pi / 2
        ElseIf Y < 0 Then
            radParam = -pi / 2
        Else
            radParam = 0
        End If
    End If
   
    ' Normalize the radian angle to be between 0 and 2*PI
    Do While radParam < 0
        radParam = radParam + (2 * pi)
    Loop
    Do While radParam >= (2 * pi)
        radParam = radParam - (2 * pi)
    Loop
   
    GeoToParametricRads = radParam
End Function

' Execute
UpdateEllipticalArcAngles
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)