News:

Interested in some really terrific mobile apps? Visit www.turboapps.com for details.

Main Menu
TurboCAD 2026 Platinum box
Now available

TurboCAD 2026.2

The latest update for TurboCAD 2026. It installs over any 2026 build and keeps your activation, drawings and settings. Get it from the Start Page or Help > Check for Update.

Variable, flexible pattern

Started by sauerkraut2018, August 23, 2024, 12:06:38 AM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

sauerkraut2018

Hello,

after you went to bed in your last post, you've probably had a good night's sleep.  ;)
Did you sleep well?

The following...
I want to create a variable, flexible pattern. The pattern should consist of a series of circles (or other shapes), for example. The circles should now be variable. E.g. 1st circle d=40, 2nd circle d=30, 3rd circle d=20, 4th circle d=10,...
The distances between the circles should also (ideally) increase or decrease.

Can I realize my wish with Turbocad?

Could my plan be successful with a ppm?

I'm attaching a picture of what it could look like.



Thanks for your suggestions
#-----
Very low knowledge of English - I ask for indulgence - Thanks
Currently installed
TurboCAD Professional 32-bit V.17.2.77.1
TurboCAD 2016 ProPlatinum 64-bit V23.2-61.2 engl.
TurboCAD 2021 Platinum 64-bit V28.0 B.82.3 de.
#-----

Torfinn

#1
That should not be a problem at all with a ppm Surkål
Just to set the distance, and start radius, the in/ de crease of number and direction, or options for one of them, and then it is up to you if you want to use numbers or size of circles compered to radius to stop it make more circles

Torfinn
V20, V21, 2015 > 2024  Platinum
Deluxe 2015/ 16/ 19
RedSDK enabled
Windows 10 Home Premium (20H2/ 19042.1083) 64 bit, 32 GB
NVIDIA Geforce GTX 780m, 1 GB

Andy H

#2
I was just going to post.  Sorry, you picked a subject I know nothing about (ppm's), Torfinn. Nikki and Alvin are the people for that type of stuff.  If I was doing it, I would write a macro.  But ppm's should be a lot simpler than a macro.

Alvin Gregorio

Quote from: sauerkraut2018 on August 23, 2024, 12:06:38 AMI want to create a variable, flexible pattern. The pattern should consist of a series of circles (or other shapes), for example. The circles should now be variable. E.g. 1st circle d=40, 2nd circle d=30, 3rd circle d=20, 4th circle d=10,...
The distances between the circles should also (ideally) increase or decrease.

Creating a .ppm script is the first thing that comes to mind.  Should be very quick and easy-- and effective.

TurboCAD's Constraints would also probably work well.

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

#4
Quote from: sauerkraut2018 on August 23, 2024, 12:06:38 AMI want to create a variable, flexible pattern

I am creating a Drawing file using Constraints.
I need some parameters.
What are the limiting scenarios?
(please describe in detail how you are going to utilize this thing)

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)

sauerkraut2018

Hello,

First of all, thank you for your contributions.

@Alvin:
I don't think constraints work because it's not as flexible as ppm. Also because you're bound. You can't move it.

I've thought of two cases (situations):
I have a fixed number of circles between 1 and 10... that need to be divided.

Case 1, the circles are fitted into the total width:
The first and last circle diameters (5mm, 25mm) and the number of circles (6) are known.
The total distance is also known, max. distance from the outer edge, quadrant of circle 1 to the outer edge, quadrant of the last circle (800mm).
The circle distances from center to center would therefore have to be calculated. In addition, the gradation must be calculated, e.g. circle 1=R1=5mm, circle 6=R6=25mm, gradation, calculated radii: 5, 9, 13, 17, 21, 25 mm
In this example, the circle spacing is (154mm)
Calculation: 5+5x154+25= 800mm

Case 2, the distance between the quadrants of the circle is fixed
The first and last circle diameters and the number of circles are known (R1=5mm, R6=25mm)
In this case, the fixed distance between the quadrant spacing is known (5x130mm)
The total width and the gradation would have to be calculated in this case.
Calculation: 2x5+2x9+2x13+2x17+2x21+2x25+5x130= 830mm


#-----
Very low knowledge of English - I ask for indulgence - Thanks
Currently installed
TurboCAD Professional 32-bit V.17.2.77.1
TurboCAD 2016 ProPlatinum 64-bit V23.2-61.2 engl.
TurboCAD 2021 Platinum 64-bit V28.0 B.82.3 de.
#-----

nikkipollard

You could do it with ppms - but you would have to limit the number to say 10 - because each variation would need to be coded. we need a loop function in PPM!!
It would be very easy to program using the SDK - macro recorder - but the result wouldn't parametric unless you did a lot of extra programming.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Alvin Gregorio

Quote from: sauerkraut2018 on August 23, 2024, 11:06:39 PMCase 1, the circles are fitted into the total width:
The first and last circle diameters (5mm, 25mm) and the number of circles (6) are known.
The total distance is also known, max. distance from the outer edge, quadrant of circle 1 to the outer edge, quadrant of the last circle (800mm).
The circle distances from center to center would therefore have to be calculated. In addition, the gradation must be calculated, e.g. circle 1=R1=5mm, circle 6=R6=25mm, gradation, calculated radii: 5, 9, 13, 17, 21, 25 mm

I believe you did not state this correctly.  I believe you used the terms "R" and "radii" where you meant "diameter".  Or vice-versa.
You initially state the first and last Circles have diameters of 5 and 25, respectively.
Then when you later reference those two Circles, you state them as having radii of 5 and 25.
And therefore, the math within the post does not equate.

Please clarify.

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: sauerkraut2018 on August 23, 2024, 11:06:39 PMCase 2, the distance between the quadrants of the circle is fixed
The first and last circle diameters and the number of circles are known (R1=5mm, R6=25mm)
In this case, the fixed distance between the quadrant spacing is known (5x130mm)
The total width and the gradation would have to be calculated in this case.
Calculation: 2x5+2x9+2x13+2x17+2x21+2x25+5x130= 830mm

Again, it seems you switched between referencing diameters and referencing radii.

Please clarify
_____
If I recall correctly sauerkraut, you became quite adept at PPM Scripting.
I concur that the use of TurboCAD Constraints would be too constrictive; I would like to see your PPM Scripting drafts.

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

#9
Quote from: sauerkraut2018 on August 23, 2024, 11:06:39 PMCase 1, the circles are fitted into the total width:
The first and last circle diameters (5mm, 25mm) and the number of circles (6) are known.
The total distance is also known, max. distance from the outer edge, quadrant of circle 1 to the outer edge, quadrant of the last circle (800mm).
The circle distances from center to center would therefore have to be calculated. In addition, the gradation must be calculated, e.g. circle 1=R1=5mm, circle 6=R6=25mm, gradation, calculated radii: 5, 9, 13, 17, 21, 25 mm
In this example, the circle spacing is (154mm)
Calculation: 5+5x154+25= 800mm

In this Case-1 scenario:
What stays constant?-- The space between the Circles?; or the distance from the Circles' center-points?

Known: 
>The overall dimension of all the Circles bounds; what TurboCAD Inspector Bar would report as the X value if we selected all the Circles: 800
>Quantity of Circles: 6
>The diameter of the smallest Circle (we will say it is the left-most Circle): 5
>The diameter of the largest Circle (we will say it is the right-most Circle): 25

[please open the attached in separate Tab or Window.  Ignore the Forum's self-generated following message "No message is associated with this attachment."]
You cannot view this attachment.


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

#10
This isn't exactly what you are after SauerKraut.
 But this is how I use macros for this kind of thing. My circles are at equal centres, Radii increase.

The Macro
//expanding circle macro
//Save as GrowCirc
//GrowCirc(P,num,SRadius,Rincrease,Centres)
Units(1[mm])

Input(P,num,SR,d1,Cen)
P = Point(0,0)
num = 3 //number of circles - max 10
SR = 30  // start radius
d1 = 5 // increase in radius
Cen = 150 // Centres

x1 = PointX(P)
y1 = PointY(P)

c1 = Circle(SR,x1,y1)
c2 = IF(num>1,Circle(SR+d1,Cen+x1,y1),"")
c3 = IF(num>2,Circle(SR+(d1*2),(Cen*2)+x1,y1),"")
c4 = IF(num>3,Circle(SR+(d1*3),(Cen*3)+x1,y1),"")
c5 = IF(num>4,Circle(SR+(d1*4),(Cen*4)+x1,y1),"")
c6 = IF(num>5,Circle(SR+(d1*5),(Cen*5)+x1,y1),"")
c7 = IF(num>6,Circle(SR+(d1*6),(Cen*6)+x1,y1),"")
c8 = IF(num>7,Circle(SR+(d1*7),(Cen*7)+x1,y1),"")
c9 = IF(num>8,Circle(SR+(d1*8),(Cen*8)+x1,y1),"")
c10 = IF(num>9,Circle(SR+(d1*9),(Cen*9)+x1,y1),"")

Output(c1,c2,c3,c4,c5,c6,c7,c8,c9,c10)




A macro for Floor - it doesn't always work we need a proper Floor function - If someone can fix it Please do.

//floor macro
Units (1[mm])
//divisor= Parameter("divisor",1, LINEAR);
//dividend= Parameter("dividend", 1000.45, LINEAR);
number=3057.5636

Input(number);

n1 = number*10
n2 = Mod(n1,10)

c = 4503599627370496; //MAGIC NUMBER!
intermediate = number + c;
rounded = intermediate - c;

Show = IF(n2<5,rounded,rounded-1)

Output(Show)


and the Main PPM - I got bored at 50 but you could quite easily go to 200.
//Expanding Circles
Units(1[mm])
R1 = Parameter("Start Radius",50,LINEAR)
R2 = Parameter("End Radius",100,LINEAR)
Num = Parameter("Number",28,Interval(1,50))

P1 = ParameterPoint(0,0,0,0)
P2 = ParameterPoint(1,2500,0,0)


x1 = PointX(P1)
y1 = PointY(P1)
x2 = PointX(P2)
y2 = PointY(P2)

dx1 = x2-x1
dy1 = y2-y1

L = sqrt(dx1*dx1 + dy1*dy1)
alpha = atan(dy1,dx1)
rinc = (R2-R1)/(Num-1)
cents = L /(Num-1)


num1= IF(Num==25,2,Floor(Num/10))
numa = Num - num1*10



//GrowCirc(P,num,SRadius,Rincrease,Centres)
Line = Polyline(P1,P2)
//First Set of circles
C1 = GrowCirc(Point(0,0),numa,R1,rinc,cents)
R3 = (numa-1)*rinc+R1
d2= numa*cents
d3 = 10*cents

//additional circles in sets of 10
C2 = IF(Num > 10,GrowCirc(Point(d2,0),10,R3,rinc,cents),"")
C3 = IF(Num > 20,GrowCirc(Point(d2+d3,0),10,R3+9*rinc,rinc,cents),"")
C4 = IF(Num > 30,GrowCirc(Point(d2+d3*2,0),10,R3+18*rinc,rinc,cents),"")
C5 = IF(Num > 40,GrowCirc(Point(d2+d3*3,0),10,R3+27*rinc,rinc,cents),"")

show = Move(RotateZ(Group(C1,C2,C3,C4,C5),alpha),x1,y1)
RefP = RefPoint(x1,y1)

Output(RefP,Line,show)

Use the select, edit nodes to change the length and angle, Selection info to change parameters.

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

Alvin Gregorio

#11
For Case-1/Opt.1, the attached sort of works.
[please open large-resolution image file in system viewer or New Tab or New Window]

Once the constant Values-- i.e.: Circle Quantity; Circle-1 Diameter; Circle-6 Diameter; Total Dimension-- are entered in the Calculator palette, and the drawing updates, one can Copy out the 6 circles and Paste them as/where desired.

The base is the Point Object at the very left.  Select and move that, and everything moves with it.


EDIT:  I found an error (probably first of a few).   Let me know if you are interested in the fix.
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

#12
And the Vb script version - isn't parametric but you aren't limited by the number of Circles.
Copy into the macro recorder Select a line and run the script.
I have kept both very basic.
Option Explicit
                                                   
'====================================================================
   '# DESCRIPTION
    'Draws circles with increasing sizes along a line
'=====================================================================
Dim tcDraw


Call Main

  Set tcDraw = Nothing

'_______________________________________________________________________________
Sub Main
   dim x1,y1,x2,y2,L,StartRadius,EndRadius,Number,Rinc,Clen,R,gap,Alpha
 Dim gGroup
 StartRadius = 50.0
 EndRadius = 200.0
 Number = 10
 Dim i
 
 Set tcDraw = ActiveDrawing

 If Selection.Count = 0 Then
MsgBox "Please Select a line First"
Exit Sub
 End If

Dim gfx : Set gfx = Selection(0)
 Dim typ
 typ = gfx.Properties.Item("M_ObjectType").Value
 If typ <> "Line" Then
 MsgBox "Wrong Graphic type selected"
Exit Sub
 End If
 Number = InputBox("Number","",Number)
  If StartRadius = 0 Then Exit Sub   'user cancelled
 StartRadius = InputBox("Start Radius","Get Radius",StartRadius)
 If StartRadius = 0 Then Exit Sub   'user cancelled
 EndRadius = InputBox("End Radius","",EndRadius)
  If EndRadius = 0 Then Exit Sub   'user cancelled
 
  Dim Verts
  Set Verts = gfx.Vertices
  Verts.UseWorldCS = True
  x1 = Verts(0).X
  y1 = Verts(0).Y
  x2 = Verts(1).X
  y2 = Verts(1).Y
 
  L = sqr((x2-x1)^2 + (y2-y1)^2)
  Rinc = (EndRadius-StartRadius) / (Number-1)
   Alpha = atan2(y2-y1,x2-x1)
  Set gGroup = TcDraw.Graphics.Add(7)
  Clen = 0
  R = StartRadius
  For i = 1 to Number
  Clen = Clen + R*2
  R = R + Rinc
  Next
  Clen = Clen-StartRadius-EndRadius
 
  gap = (L-Clen)/(Number-1)
 R = -StartRadius-Gap
 For i = 0 to Number-1
  R = R + StartRadius + gap
 Call gGroup.Graphics.AddCircleCenterAndPoint(x1+R*cos(Alpha),y1+R*sin(Alpha),0,x1+R*cos(Alpha)+StartRadius,y1+R*sin(Alpha),0)
  R = R + StartRadius
  StartRadius = StartRadius+Rinc
 
  Next
 gGroup.Name = "Expanding Circles"

 tcDraw.ActiveView.Refresh
Set Verts = Nothing
Set gfx = Nothing
Set gGroup = Nothing
End Sub

'________________________________________________________________________________
'******************************************************************************************************************************
Function atan2(ys, xs)
' from the Draw Arrows tip
' by Jim Deutch, Syracuse, New York
Dim theta
 dim pi
 pi = 3.1415926535897932384626433832795
    If xs <> 0 Then
        theta = Atn(ys / xs)
        If xs < 0 Then
            theta = theta + pi
        End If
    Else
        If ys < 0 Then
            theta = 3 * pi / 2 '90
        Else
            theta = pi / 2 '270
        End If
    End If
atan2 = theta
End Function
'*****************************************************************************************************************************


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

Alvin Gregorio

#13
And the attached works for the Case-1/Opt.2 scenario.
Sort of; not as good as a script.


EDIT:  I found an error (probably first of a few).   Let me know if you are interested in the fix.
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)

sauerkraut2018

Wow, I'm overwhelmed by so much help, thank you so much.

I'll respond to your posts one by one.

#--------------------------------------------
Post #7 Alvin
I believe you did not state this correctly.  I believe you used the terms "R" and "radii" where you meant "diameter".  Or vice-versa.
You initially state the first and last Circles have diameters of 5 and 25, respectively.
Then when you later reference those two Circles, you state them as having radii of 5 and 25.
And therefore, the math within the post does not equate.

Please clarify.

Sorry Alvin, you're absolutely right. But since I've also tested and tried something, I found that the "Circle" command requires a radius, not a diameter.
#--------------------------------------------
Post #8 Alvin
Answer as in post 7. I'm getting old and forgetful.

If I recall correctly sauerkraut, you became quite adept at PPM Scripting.
I concur that the use of TurboCAD Constraints would be too constrictive; I would like to see your PPM Scripting drafts.

I worked with ppms a long time ago. But unfortunately most of it has been lost. Too old and forgetful.
My PPM scripting drafts are still in their infancy. I started with the parameters and with the output of the parameters. I haven't been able to finish any more than that yet.
#--------------------------------------------
Post #9 Alvin
In this Case-1 scenario:
What stays constant?-- The space between the Circles?; or the distance from the Circles' center-points?
It is the distance from the Circles' center-points

In your picture
Opt1, above is correct = Case 1
Opt 2, below is the second case = Case 2
#--------------------------------------------
Post #10 Nikki
Hi Nikki,
When I find a quiet hour, I have to take a closer look at your scripts. I think I will be able to use parts of them.
Great work
#--------------------------------------------
Post #11 Alvin
Alvin, is that the solution with constraints?
#--------------------------------------------
Post #12 Nikki
I wish I could write VB scripts too. Unfortunately I can't.
I looked at Turbocad's tcsdk.chm a few months ago. Unfortunately, to no avail.
Even the start of which editor to use to write scripts failed because I don't have MS Excel either.
#--------------------------------------------
Post #13 Alvin
Alvin, is that the solution with constraints?
I am interested in all solutions. You never stop learning (and forget a lot).
Even if I only use parts of your scripts in the end, you have still helped me a lot.
#--------------------------------------------

@all:
Thank you very much again for your help and detailed contributions.
And please excuse my terrible English.

#-----
Very low knowledge of English - I ask for indulgence - Thanks
Currently installed
TurboCAD Professional 32-bit V.17.2.77.1
TurboCAD 2016 ProPlatinum 64-bit V23.2-61.2 engl.
TurboCAD 2021 Platinum 64-bit V28.0 B.82.3 de.
#-----

Alvin Gregorio

Quote from: sauerkraut2018 on August 24, 2024, 08:29:23 AM#--------------------------------------------
Post #11 Alvin
Alvin, is that the solution with constraints?

Yes


Quote from: sauerkraut2018 on August 24, 2024, 08:29:23 AMPost #13 Alvin
Alvin, is that the solution with constraints?
Yes
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: sauerkraut2018 on August 24, 2024, 08:29:23 AM#--------------------------------------------
Post #11 Alvin
Alvin, is that the solution with constraints?

Quote from: sauerkraut2018 on August 24, 2024, 08:29:23 AMPost #13 Alvin
Alvin, is that the solution with constraints?

Please let me know if you plan on experimenting with my .tcw Constraint files.
They have an error that needs to be corrected, I can show you the correction via annotated screen-capture.
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)

John Kohlmeyer

Sauerkraut2018,

I know nothing about PPM, TC constraints, or SDK macros so I don't have anything to offer concerning your ongoing project.  I do, however, wish to comment on your last comment.  You have absolutely nothing to apologize for when it comes to your English.  From what I have seen in your posts, you have a very good command of the language – as good or better than many people who speak it as their native tongue.

For quite a while, whenever I was reading one of your posts, I have been thinking 'he needs to remove the claim of "Very low knowledge of English" ' from his signature.  I admire anyone who can speak more than one language, and I applaud you.  No need to request indulgence anymore.

Good luck with your project.  It appears there are many who are willing to help.

John
TurboCAD 2021 Platinum, v28.0 build 81.1
Windows 10 Home
Intel Core i7-9700 3.00 GHz
32 GB RAM
NVIDIA GeForce RTX 2070 SUPER

sauerkraut2018

Post #15 und Post #16 Alvin
Hello Alvin,

I'm very happy that you're making such an effort. But I thought I had already expressed that I wanted to try ppm.
Nevertheless, I will examine and test your current files.
Thank you very much for your offer.

Post #17 John
Hello John,
At my age, any praise is appreciated. So I thank you for your contribution and the praise.

But I should also tell you that it's "only" Google English. Only with this help can I follow the explanations here in the forum. And by the way, speaking is much more difficult for me than writing.


#-----
Very low knowledge of English - I ask for indulgence - Thanks
Currently installed
TurboCAD Professional 32-bit V.17.2.77.1
TurboCAD 2016 ProPlatinum 64-bit V23.2-61.2 engl.
TurboCAD 2021 Platinum 64-bit V28.0 B.82.3 de.
#-----

nikkipollard

Quote from: sauerkraut2018 on August 24, 2024, 08:29:23 AMWow, I'm overwhelmed by so much help, thank you so much.

I'll respond to your posts one by one.

#--------------------------------------------
Post #7 Alvin
I believe you did not state this correctly.  I believe you used the terms "R" and "radii" where you meant "diameter".  Or vice-versa.
You initially state the first and last Circles have diameters of 5 and 25, respectively.
Then when you later reference those two Circles, you state them as having radii of 5 and 25.
And therefore, the math within the post does not equate.

Please clarify.

Sorry Alvin, you're absolutely right. But since I've also tested and tried something, I found that the "Circle" command requires a radius, not a diameter.
#--------------------------------------------
Post #8 Alvin
Answer as in post 7. I'm getting old and forgetful.

If I recall correctly sauerkraut, you became quite adept at PPM Scripting.
I concur that the use of TurboCAD Constraints would be too constrictive; I would like to see your PPM Scripting drafts.

I worked with ppms a long time ago. But unfortunately most of it has been lost. Too old and forgetful.
My PPM scripting drafts are still in their infancy. I started with the parameters and with the output of the parameters. I haven't been able to finish any more than that yet.
#--------------------------------------------
Post #9 Alvin
In this Case-1 scenario:
What stays constant?-- The space between the Circles?; or the distance from the Circles' center-points?
It is the distance from the Circles' center-points

In your picture
Opt1, above is correct = Case 1
Opt 2, below is the second case = Case 2
#--------------------------------------------
Post #10 Nikki
Hi Nikki,
When I find a quiet hour, I have to take a closer look at your scripts. I think I will be able to use parts of them.
Great work
#--------------------------------------------
Post #11 Alvin
Alvin, is that the solution with constraints?
#--------------------------------------------
Post #12 Nikki
I wish I could write VB scripts too. Unfortunately I can't.
I looked at Turbocad's tcsdk.chm a few months ago. Unfortunately, to no avail.
Even the start of which editor to use to write scripts failed because I don't have MS Excel either.
#--------------------------------------------
Post #13 Alvin
Alvin, is that the solution with constraints?
I am interested in all solutions. You never stop learning (and forget a lot).
Even if I only use parts of your scripts in the end, you have still helped me a lot.
#--------------------------------------------

@all:
Thank you very much again for your help and detailed contributions.
And please excuse my terrible English.



Hi Sauerkraut
The VBscript was written in the macro recorder. Using the same language as macro's are written.
There is a lot of help on the Web for writing vbscript code.
For now that still works.  I am mainly write scripts using VB.net in the community version of Visual Studio
(Free). The languages are very similar so it is quite easy to switch between the 2.

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

sauerkraut2018

Hello Nikki,

QuoteI am mainly write scripts using VB.net in the community version of Visual Studio
(Free). The languages ��are very similar so it is quite easy to switch between the 2.

Aren't VB.net and Visual Studio two different programs?
Is VB.net also required?

I downloaded "Visual Studio 2022 Community (Free)". What are the next steps?

Please write me a short guide on how to install it and which
settings I need to pay particular attention to in order to use it for/with Turbocad.

Since Turbocad is very sensitive to some things, I don't want TurboCad to be damaged.

FYI - I installed TurboCad on a separate computer that is NOT online.

Thank you for your patience and effort.
#-----
Very low knowledge of English - I ask for indulgence - Thanks
Currently installed
TurboCAD Professional 32-bit V.17.2.77.1
TurboCAD 2016 ProPlatinum 64-bit V23.2-61.2 engl.
TurboCAD 2021 Platinum 64-bit V28.0 B.82.3 de.
#-----

Alvin Gregorio

Quote from: nikkipollard on August 24, 2024, 05:00:07 AMAnd the Vb script version - isn't parametric but you aren't limited by the number of Circles.
Copy into the macro recorder Select a line and run the script.
I have kept both very basic.
]code[

I just ran the script Nikki.  Nice work.

Come winter months, I might have to explore Macros and VB Scripts.


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

Hi Sauerkraut

I am not a programmer, so I am sharing this a little hesitantly.
It is a kind of hello world, for the Turbocad SDK, using VB.net tutorial.

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

sauerkraut2018

Hello Alvin, Hello Nikki,

@Alvin
I hope it's winter soon. I think I'll go along with your suggestion. :-)

@Nikki
I've started reading your tutorial PDF file and have tried to implement it.

But now I have another problem. As described earlier, my CAD computer is not online.

I tried to install Visual Studio on the CAD computer. The installation started and then stopped shortly afterwards.
An error message appeared.
"This Application requires .NET Framework 4.6 or higher to be installed."

I checked it and also tried to install versions 4.6 and 4.8.
Another error message appeared saying that a newer version was already installed. As far as I can tell,
I already have Runtime Version 6.0.23.32930 (x64) installed.
I'm at a loss as to how I should/can proceed.

#-----
Very low knowledge of English - I ask for indulgence - Thanks
Currently installed
TurboCAD Professional 32-bit V.17.2.77.1
TurboCAD 2016 ProPlatinum 64-bit V23.2-61.2 engl.
TurboCAD 2021 Platinum 64-bit V28.0 B.82.3 de.
#-----

Alvin Gregorio

Quote from: nikkipollard on August 25, 2024, 08:51:45 PMI am not a programmer, so I am sharing this a little hesitantly.
It is a kind of hello world, for the Turbocad SDK, using VB.net tutorial.

*TurboCad SDK tutorial.pdf

Thank You Nikki

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: sauerkraut2018 on August 26, 2024, 02:43:20 AMBut now I have another problem. As described earlier, my CAD computer is not online.
I tried to install Visual Studio on the CAD computer. The installation started and then stopped shortly afterwards.
...
I'm at a loss as to how I should/can proceed.
I would Download the application onto a USB stick via this computer; then insert the USB stick into the CAD computer and install from that USB stick on the CAD computer.
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)

sauerkraut2018

Hello Alvin,

QuoteI would Download the application onto a USB stick via this computer; then insert the USB stick into the CAD computer and install from that USB stick on the CAD computer.

Thanks for your suggestion, but it probably won't work.
Please read my post #23 again.

1. When I download Visual Studio 2022, I only get an installer that has a file size of 4318KB.
An internet connection is required to install Visual Studio.
In any case, I haven't found a complete VisualStudio (approx. 2.18GB) to download.
2. As described, an error message appears that a version of .NET Framework is not available.
.NET Framework is an additional program and is required by Visual Studio.
The attempt to install the missing version fails.
Version 4.6 or 4.8 of .NET Framework is expected.
But 6.0.23.32930 (x64) already seems to be installed on my computer.
3. My computer is offline to protect TC. As soon as I go online, Windows tries to install any updates
that would damage my TurboCAD.

#-----
Very low knowledge of English - I ask for indulgence - Thanks
Currently installed
TurboCAD Professional 32-bit V.17.2.77.1
TurboCAD 2016 ProPlatinum 64-bit V23.2-61.2 engl.
TurboCAD 2021 Platinum 64-bit V28.0 B.82.3 de.
#-----

nikkipollard

#27
You can write scripts directly in the macro recorder too.
The script I shared earlier was written in the macro recorder palette.
If you need colour you can write them in Notepad++.
I have a user defined language set up specifically for Turbocad SDK in Notepad++.
It is great for quick scripts.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

sauerkraut2018

Hello,

now it's time to report back to you.

I've now managed to write a ppm that, as far as I can tell, works.

By entering 2 circle radii and a total distance, I get the desired output. In this version, the distance between the circles (10) is divided evenly.

In the other (2,) case, the smaller circle diameter is now entered. The fixed distance between the individual circles is also entered. In this case, the increasing radii are calculated. Here, too, there are 10 circles.

The next step is (would be) to vary the number of circles between 2 and 9. I suspect it could work with several macros. But I'm still working on a (pleasant) comprehensible solution.

That's my report.

Quote...If you need colour you can write them in Notepad++.
I have a user defined language set up specifically for Turbocad SDK in Notepad++...

Thanks for your feedback. As I already wrote, VisualStudio doesn't work on my computer.

I have Notepad++ installed on this computer.
Therefore, it would be nice to know how you integrated or installed TurboCAD SDK in Notepad++. That would be great of you, thank you.

I would like to thank you for the attached PDF. I would like to reproduce it in Notepad++ with SDK.

#-----
Very low knowledge of English - I ask for indulgence - Thanks
Currently installed
TurboCAD Professional 32-bit V.17.2.77.1
TurboCAD 2016 ProPlatinum 64-bit V23.2-61.2 engl.
TurboCAD 2021 Platinum 64-bit V28.0 B.82.3 de.
#-----

Alvin Gregorio

Quote from: sauerkraut2018 on August 30, 2024, 01:54:22 AMI've now managed to write a ppm that, as far as I can tell, works.
In exchange for our involvement sauerkraut, would you please share with us that .ppm script.
I want to learn from it; I could not figure out a way to have the graudated-radii inner circles increase in diameter correspondingly.
Thank you, 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)

nikkipollard

#30
Quote from: sauerkraut2018 on August 30, 2024, 01:54:22 AMHello,

now it's time to report back to you.

I've now managed to write a ppm that, as far as I can tell, works.

By entering 2 circle radii and a total distance, I get the desired output. In this version, the distance between the circles (10) is divided evenly.

In the other (2,) case, the smaller circle diameter is now entered. The fixed distance between the individual circles is also entered. In this case, the increasing radii are calculated. Here, too, there are 10 circles.

The next step is (would be) to vary the number of circles between 2 and 9. I suspect it could work with several macros. But I'm still working on a (pleasant) comprehensible solution.

That's my report.

Quote...If you need colour you can write them in Notepad++.
I have a user defined language set up specifically for Turbocad SDK in Notepad++...

Thanks for your feedback. As I already wrote, VisualStudio doesn't work on my computer.

I have Notepad++ installed on this computer.
Therefore, it would be nice to know how you integrated or installed TurboCAD SDK in Notepad++. That would be great of you, thank you.

I would like to thank you for the attached PDF. I would like to reproduce it in Notepad++ with SDK.



You don't need visual studio. You can write scripts in the macro recorder palette.
Copy my script, open the macro recorder and paste. Select a line and click run. For simple tasks it works perfectly.

Or Try this
Open the macro recorder in Turbocad
Type
Call ActiveDrawing.Graphics.AddCircleCenterAndPoint(0,0,0,100,0,0)

Click the blue arrow to run the script. A 100 mm circle should be drawn at 0,0.

If that works then my script should also work on your computer.

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

sauerkraut2018

#31
Hello,

thank you both.  :)

@Alvin:
Here is the ppm.

#-----
Very low knowledge of English - I ask for indulgence - Thanks
Currently installed
TurboCAD Professional 32-bit V.17.2.77.1
TurboCAD 2016 ProPlatinum 64-bit V23.2-61.2 engl.
TurboCAD 2021 Platinum 64-bit V28.0 B.82.3 de.
#-----