The challenge for the iLogic

The challenge for the iLogic

Anonymous
Not applicable
615 Views
6 Replies
Message 1 of 7

The challenge for the iLogic

Anonymous
Not applicable

1. Imagine, you have to place  array of scale-down holes on a nonplanar surface. Is it possible to implement this problem through iLogic function? And use it in the future for different surfaces?

2. And how to make an array of holes with the diameter reduction?

3. And how to get rid of errors in the operation of the extrusion holes?

 

2017-01-19_170716.jpg2017-01-19_170938.jpg2017-01-19_171141.jpg2017-01-19_171329.jpg2017-01-19_171524.jpg2017-01-19_171603.jpg

 

0 Likes
Accepted solutions (1)
616 Views
6 Replies
Replies (6)
Message 2 of 7

Owner2229
Advisor
Advisor

Hey

1. Everything you can do manually can be done by code, it just depends on the amount of work.

Can you share the file?

How do you want to select the "place" where should the holes be? Is there a rule (specified position) for that?

What is the origin of the spline, is it projected from the shape? If so, what part of it?

Which features will be present and which do you want to create by the code? (Workplanes, the spline, the lines, the circles' center points)

Where should the holes start?

Are the holes' planes perpendicular or parallel to something? The lines maybe?

Where do the lines come from and where do they lead?

 

2. Here's a sample for that:

 

Dim oDoc As Document = ThisApplication.ActiveDocument
Dim oCD As ComponentDefinition = oDoc.ComponentDefinition
Dim TG As TransientGeometry = ThisApplication.TransientGeometry
Dim oPlane As WorkPlane = oCD.WorkPlanes(1)
Dim oSketch As Sketch = oCD.Sketches.Add(oPlane)
oSketch.Edit
Dim CircleDia As Double = 11
Dim DiaReduce As Double = 2
Dim CircleCount As Integer = 5
Dim PointX As Double = 0
Dim PointY As Double = 0
For i = 0 To CircleCount
	Dim CirclePoint As Point2D = TG.CreatePoint2d(PointX, PointY)
	oSketch.SketchCircles.AddByCenterRadius(CirclePoint, CircleDia/2)
	PointX = PointX + CircleDia
	CircleDia = CircleDia - DiaReduce
Next
oSketch.ExitEdit

3. Can you translate the errors for us, so I can see what it wants? Anyway, it can be suppressed like this:

 

ThisApplication.SilentOperation = True
Try
     'Do some operations
Catch
End Try
ThisApplication.SilentOperation = False

 

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
0 Likes
Message 3 of 7

Anonymous
Not applicable

Place for the opening is always on the spline. Spline - it is rather isocurve, because the surface is always on and repeats it.
The points for the holes to be selected counter. And the diameter should be selected only two - the largest and the smallest. The diameters between large and small should decrease uniformly.
For example: 1. The large diameter of 5mm, 0.7mm small
                    2. Step between holes 0.2mm
As a result, iLogic must calculate the number of holes in increments of 0.2mm in said isocurve and reduce the diameter from 5mm to 0.7mm evenly. Or choose to reduce the diameter of the said advance otdelnom box (a list of diameters). If it is not possible to place these holes display a message that is not possible to place a given number of openings of the curve on this curve.
Start holes can be set using the indent (specify manually).
Yes holes are always perpendicular to the surface.
Lines - a (very often) offset from the surface of the rib (in rinoceros - this is called isocurve)

Post Inventor:

(Failed to create the hole.Part1.ipt: Error updating An error in the calculation of the sketch. Use the "Sketch" command tochange sketch geometry or relationships.3D Sketch2: Problems when you try to perform an operation of 3D sketch)

0 Likes
Message 4 of 7

Anonymous
Not applicable

...otdelnom box - dialog box...

0 Likes
Message 5 of 7

Owner2229
Advisor
Advisor
Accepted solution

Alright then, "isocurve". Should the isocureve be offset from the projected line or just drawn "somewhere on the shape's face"?

Could, by any chance, be used the original curve from the 3d sketch? Aka it's projection to the outer surface.

The axis, workplanes, sketches and extrusion should not be a problem, they'll be created on the curve's points.

Should the points have equal spacing or be driven by an equation?

 

Here's the code to calculate the amount of holes:

Dim lDia As Double = 5    'Later we'll set this value from the user's input
Dim sDia As Double = 0.7  'Later we'll set this value from the user's input
Dim aStep As Double = 0.2 'Later we'll set this value from the user's input
Dim CircleCount As Integer = Math.Floor((lDia - sDia) / aStep) + 1
For i = 1 To CircleCount
     Dim aDia As Double = lDia - ((i - 1) * aStep)
     If i = CircleCount Then aDia = sDia
     'Here we're gonna use the variable "aDia" as the diameter for each circle
Next 

 

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
Message 6 of 7

Anonymous
Not applicable

ok, thx) 

Tell me please where I can get the maximum information about usage of ilogic module
 
with the examples of constructive usage
0 Likes
Message 7 of 7

Owner2229
Advisor
Advisor

You can eighter search in this forum, or on mode-the-machine blog:

http://modthemachine.typepad.com

 

Or simply in Inventor:

Inventor HELP button > Help > Programming/API help

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
0 Likes