Development version shape library
- Les Newell
- Site Admin
- Posts: 3687
- Joined: Thu May 11, 2006 8:12 pm
Re: Development version shape library
It needs to be inside the function. x and y need to be set to the x and y coordinates of the centroid of the shape.
-
- Posts: 452
- Joined: Wed Sep 12, 2018 8:18 pm
- Location: South Carolina, USA
- Contact:
Re: Development version shape library
Heck yea, that fixed it! Thanks! Works exactly as I intended now. Or seems to at the moment anyways. I really wish I had the time to learn how to code better... seems like I know just enough to be dangerous and annoying lol
-
- Posts: 452
- Joined: Wed Sep 12, 2018 8:18 pm
- Location: South Carolina, USA
- Contact:
Re: Development version shape library
Hey Les, some of the comments in the shape files say a line of zero length creates a point but i am not getting anything any points being created. I wanted to add a point shape so i could use the drill operation to just make a pierce hole to locate holes that need to be machine drilled or something.
Here is the code:
I first tried just the "Line(sh..." and got nothing so i tried putting in a circle that i know generates and the circle is added to the part, but not the line or point. Any thoughts what's causing this.
Here is the code:
Code: Select all
Circle(shape.X, shape.Y, 20)
Line(shape.X, shape.Y, shape.X, shape.Y)
- Les Newell
- Site Admin
- Posts: 3687
- Joined: Thu May 11, 2006 8:12 pm
Re: Development version shape library
Huh. It looks like I lied. A zero size line will be ignored. You can however use a circle of zero diameter instead.
In the next release I'll add a Point function. You can add it to your version if you want:
Run SheetCam as administrator then go to Options->plugin options->shape and click on the 'Edit macro" button.
Add this function:
It doesn't matter where you place it but for consistency I'd add it just after function Circle. This addition will be in the next release.
Now you can use Point(shape.X, shape.Y) to generate a point. Note that points won't show up until you add the shape to your part.
In the next release I'll add a Point function. You can add it to your version if you want:
Run SheetCam as administrator then go to Options->plugin options->shape and click on the 'Edit macro" button.
Add this function:
Code: Select all
function Point(x, y)
Circle(x, y, 0)
end
Now you can use Point(shape.X, shape.Y) to generate a point. Note that points won't show up until you add the shape to your part.
-
- Posts: 257
- Joined: Thu Feb 26, 2015 12:11 am
Re: Development version shape library
Code: Select all
--Circle(x, y, diameter) -- circle
--Line( x1, y1, x2, y2) -- Line from X1, Y1 to X2, Y2
--MoveTo( x, y) -- Set Current Position
--LineTo(x , y) -- Line from current position to X, Y.
--ArcA(startX, startY, CentreX, centreY, angle) -- angle in Radians, Positive Angle Clockwise
-- line with zero length = "point"
-- SHAPE NAME: Donut
shape = {}
function shape.Calculate()
local dd1 = shape.diameter1
local dd2 = shape.diameter2
Circle(0, 0, dd1)
Circle(0, 0, dd2)
end
AddNumControl("diameter1", TR("Inside Diameter"), sc.unitLINEAR, 50.8, 0.0254, 6096, "insidediameter.png")
AddNumControl("diameter2", TR("Outside Diameter"), sc.unitLINEAR, 101.6, 0.0254, 6096, "outsidediameter.png")
- Les Newell
- Site Admin
- Posts: 3687
- Joined: Thu May 11, 2006 8:12 pm
Re: Development version shape library
Hmm, you're right. I'll try to fix it for the next release.
-
- Posts: 452
- Joined: Wed Sep 12, 2018 8:18 pm
- Location: South Carolina, USA
- Contact:
Re: Development version shape library
Hey Les, I added some more shapes to the library and fixed/added some of the bitmaps and icons. I have attached my latest version of the shape library if you would like to incorporate it into the next release.
Also, something appears to still be wrong with the bitmaps showing in the shape window. The icons are displaying in the dialog fine, but none of the explanatory bitmaps are showing in the shape window when you click a box to edit.
Also, something appears to still be wrong with the bitmaps showing in the shape window. The icons are displaying in the dialog fine, but none of the explanatory bitmaps are showing in the shape window when you click a box to edit.
- Attachments
-
- shapes.zip
- (1.48 MiB) Downloaded 169 times
-
- Posts: 257
- Joined: Thu Feb 26, 2015 12:11 am
Re: Development version shape library
thanks for taking the time to continue this work
- Les Newell
- Site Admin
- Posts: 3687
- Joined: Thu May 11, 2006 8:12 pm
Re: Development version shape library
Thanks for the update. I think I know what is going on with the icons so I should have it fixed for the next release.
-
- Posts: 452
- Joined: Wed Sep 12, 2018 8:18 pm
- Location: South Carolina, USA
- Contact:
Re: Development version shape library
No problem, just glad I can help out in some way other than come up with problems lol