Hello guys,
I am new to this forum as well as to iLogic.
From my research on google and on this forum i have some questions about iLogic.
What I would like to ask you is the following:
Is it possible to create a sketch using iLogic?
If yes , how ?
If not, is it possible to create (for example) a line inside a sketch ?
I am sorry if this is too fundamental but after a day of searching i haven't come up with an answer..
Solved! Go to Solution.
Hello guys,
I am new to this forum as well as to iLogic.
From my research on google and on this forum i have some questions about iLogic.
What I would like to ask you is the following:
Is it possible to create a sketch using iLogic?
If yes , how ?
If not, is it possible to create (for example) a line inside a sketch ?
I am sorry if this is too fundamental but after a day of searching i haven't come up with an answer..
Solved! Go to Solution.
Solved by Curtis_Waguespack. Go to Solution.
Dear Tefkleidis,
Then I'll show you what I understood from your query
- Once done the "Sketch", proceed to the "Manage" tab:
- Once there, deploy "Ilogic" which is where you can add the form or manage the necessary rules:
- You can work from "Parameters" yes you need:
This is what you needed?
Dear Tefkleidis,
Then I'll show you what I understood from your query
- Once done the "Sketch", proceed to the "Manage" tab:
- Once there, deploy "Ilogic" which is where you can add the form or manage the necessary rules:
- You can work from "Parameters" yes you need:
This is what you needed?
Thank you very much for your answer but this is not exactly what i need.
Using the way you showed me, you have a rectangle created and you are able to modify the lengths of it's sides.
What I need to do, is create the rectangle from scratch. That is, having an empty sketch to go and create a rectangle and then assign user made parameters to define the lengths of it's sides.
Thank you very much for your answer but this is not exactly what i need.
Using the way you showed me, you have a rectangle created and you are able to modify the lengths of it's sides.
What I need to do, is create the rectangle from scratch. That is, having an empty sketch to go and create a rectangle and then assign user made parameters to define the lengths of it's sides.
Hi tefkleidis,
Here are 3 quick examples adapted from the Inventor API samples.
Also just as a tip, you can search and ask programming questions of this type on the Inventor Customization forum too:
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Example 1
Draw 3 lines to make a Triangle example:
' Check to make sure a sketch is open. If Not TypeOf ThisApplication.ActiveEditObject Is PlanarSketch Then MessageBox.Show("A sketch must be active.", "iLogic") Return End If 'set a reference to the active sketch. Dim oSketch As PlanarSketch oSketch = ThisApplication.ActiveEditObject 'set a reference to the transient geometry collection. Dim oTransGeom As TransientGeometry oTransGeom = ThisApplication.TransientGeometry ' Create a new transaction to wrap the construction of the three lines ' set into a single undo. Dim oTrans As Transaction oTrans = ThisApplication.TransactionManager.StartTransaction( _ ThisApplication.ActiveDocument, _ "Create Triangle Sample") ' Create the first line of the triangle. This uses two transient points as ' input to definethe coordinates of the ends of the line. Since a transient ' point is input a sketch point is automatically created at that location and ' the line is attached to it. Dim oLines(0 To 2) As SketchLine oLines(0) = oSketch.SketchLines.AddByTwoPoints(oTransGeom.CreatePoint2d(0, 0), _ oTransGeom.CreatePoint2d(4, 0)) ' Create a sketch line that is connected to the sketch point the previous lines ' end point is connected to. This will automatically create the constraint to ' tie the new line to the sketch point the previous line is also connected to. ' This will result in the the two lines being connected since they're both tied ' to the same sketch point. oLines(1) = oSketch.SketchLines.AddByTwoPoints(oLines(0).EndSketchPoint, _ oTransGeom.CreatePoint2d(2, 3)) ' Create a third line and connect it to the start point of the first line and the ' end point of the second line. This will result in a connected triangle. oLines(2) = oSketch.SketchLines.AddByTwoPoints(oLines(1).EndSketchPoint, _ oLines(0).StartSketchPoint) ' End the transaction oTrans.End iLogicVb.UpdateWhenDone = True
Example 2
2 Point Rectangle example:
' Check to make sure a sketch is open. If Not TypeOf ThisApplication.ActiveEditObject Is PlanarSketch Then MessageBox.Show("A sketch must be active.", "iLogic") Return End If 'set a reference to the active sketch. Dim oSketch As PlanarSketch oSketch = ThisApplication.ActiveEditObject 'set a reference to the transient geometry collection. Dim oTransGeom As TransientGeometry oTransGeom = ThisApplication.TransientGeometry ' Create a rectangle Dim oRectangleLines As SketchEntitiesEnumerator oRectangleLines = oSketch.SketchLines.AddAsTwoPointRectangle( _ oTransGeom.CreatePoint2d(0, 0), _ oTransGeom.CreatePoint2d(8, 5)) iLogicVb.UpdateWhenDone = True
Example 3
3 Point (rotated) Rectangle example:
' Check to make sure a sketch is open.
If Not TypeOf ThisApplication.ActiveEditObject Is PlanarSketch Then
MessageBox.Show("A sketch must be active.", "iLogic")
Return
End If
'set a reference to the active sketch.
Dim oSketch As PlanarSketch
oSketch = ThisApplication.ActiveEditObject
'set a reference to the transient geometry collection.
Dim oTransGeom As TransientGeometry
oTransGeom = ThisApplication.TransientGeometry
' Create a rotated rectangle
oRectangleLines = oSketch.SketchLines.AddAsThreePointRectangle( _
oTransGeom.CreatePoint2d(0, 0), _
oTransGeom.CreatePoint2d(7, 3), _
oTransGeom.CreatePoint2d(8, 8))
iLogicVb.UpdateWhenDone = True
Hi tefkleidis,
Here are 3 quick examples adapted from the Inventor API samples.
Also just as a tip, you can search and ask programming questions of this type on the Inventor Customization forum too:
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Example 1
Draw 3 lines to make a Triangle example:
' Check to make sure a sketch is open. If Not TypeOf ThisApplication.ActiveEditObject Is PlanarSketch Then MessageBox.Show("A sketch must be active.", "iLogic") Return End If 'set a reference to the active sketch. Dim oSketch As PlanarSketch oSketch = ThisApplication.ActiveEditObject 'set a reference to the transient geometry collection. Dim oTransGeom As TransientGeometry oTransGeom = ThisApplication.TransientGeometry ' Create a new transaction to wrap the construction of the three lines ' set into a single undo. Dim oTrans As Transaction oTrans = ThisApplication.TransactionManager.StartTransaction( _ ThisApplication.ActiveDocument, _ "Create Triangle Sample") ' Create the first line of the triangle. This uses two transient points as ' input to definethe coordinates of the ends of the line. Since a transient ' point is input a sketch point is automatically created at that location and ' the line is attached to it. Dim oLines(0 To 2) As SketchLine oLines(0) = oSketch.SketchLines.AddByTwoPoints(oTransGeom.CreatePoint2d(0, 0), _ oTransGeom.CreatePoint2d(4, 0)) ' Create a sketch line that is connected to the sketch point the previous lines ' end point is connected to. This will automatically create the constraint to ' tie the new line to the sketch point the previous line is also connected to. ' This will result in the the two lines being connected since they're both tied ' to the same sketch point. oLines(1) = oSketch.SketchLines.AddByTwoPoints(oLines(0).EndSketchPoint, _ oTransGeom.CreatePoint2d(2, 3)) ' Create a third line and connect it to the start point of the first line and the ' end point of the second line. This will result in a connected triangle. oLines(2) = oSketch.SketchLines.AddByTwoPoints(oLines(1).EndSketchPoint, _ oLines(0).StartSketchPoint) ' End the transaction oTrans.End iLogicVb.UpdateWhenDone = True
Example 2
2 Point Rectangle example:
' Check to make sure a sketch is open. If Not TypeOf ThisApplication.ActiveEditObject Is PlanarSketch Then MessageBox.Show("A sketch must be active.", "iLogic") Return End If 'set a reference to the active sketch. Dim oSketch As PlanarSketch oSketch = ThisApplication.ActiveEditObject 'set a reference to the transient geometry collection. Dim oTransGeom As TransientGeometry oTransGeom = ThisApplication.TransientGeometry ' Create a rectangle Dim oRectangleLines As SketchEntitiesEnumerator oRectangleLines = oSketch.SketchLines.AddAsTwoPointRectangle( _ oTransGeom.CreatePoint2d(0, 0), _ oTransGeom.CreatePoint2d(8, 5)) iLogicVb.UpdateWhenDone = True
Example 3
3 Point (rotated) Rectangle example:
' Check to make sure a sketch is open.
If Not TypeOf ThisApplication.ActiveEditObject Is PlanarSketch Then
MessageBox.Show("A sketch must be active.", "iLogic")
Return
End If
'set a reference to the active sketch.
Dim oSketch As PlanarSketch
oSketch = ThisApplication.ActiveEditObject
'set a reference to the transient geometry collection.
Dim oTransGeom As TransientGeometry
oTransGeom = ThisApplication.TransientGeometry
' Create a rotated rectangle
oRectangleLines = oSketch.SketchLines.AddAsThreePointRectangle( _
oTransGeom.CreatePoint2d(0, 0), _
oTransGeom.CreatePoint2d(7, 3), _
oTransGeom.CreatePoint2d(8, 8))
iLogicVb.UpdateWhenDone = True
Guys thank you very much for your answers!
G.Hunter, that is ineed possible however it does not apply in my circumstance because i would like my sketches to have different features.. For example depending on the occasion, I would like a sketch with 1 point or 10 or 100. That is why I need a way to be able to create points.
Curtis, thank you as well. From what I understand after my searching and your answer the only way to do what I need is through VBA and not iLogic so I will give that a try!
Guys thank you very much for your answers!
G.Hunter, that is ineed possible however it does not apply in my circumstance because i would like my sketches to have different features.. For example depending on the occasion, I would like a sketch with 1 point or 10 or 100. That is why I need a way to be able to create points.
Curtis, thank you as well. From what I understand after my searching and your answer the only way to do what I need is through VBA and not iLogic so I will give that a try!
It might help to describe exactly what you are trying to accomplish (maybe with some examples).. There might be other "better" ways to accomplish your task vs having to run/develope a program to do simple sketching..
You mentioned "points"... Have you looked into how Inventor can import point cloud data (like from a 3d scanner,etc..) ?.. Get your points into a suitable "point cloud data format" and voila.. Imports right into Inventor..no need to write any coding really.
https://www.youtube.com/watch?v=WTg62YbBbhA
It might help to describe exactly what you are trying to accomplish (maybe with some examples).. There might be other "better" ways to accomplish your task vs having to run/develope a program to do simple sketching..
You mentioned "points"... Have you looked into how Inventor can import point cloud data (like from a 3d scanner,etc..) ?.. Get your points into a suitable "point cloud data format" and voila.. Imports right into Inventor..no need to write any coding really.
https://www.youtube.com/watch?v=WTg62YbBbhA
What I want to do is the following:
Automate the creation of a specific part. Because it is time consuming to do every time a new part I would like to have a form in which I will input some key values and via iLogic the part will be generated automatically.
The problem is that the part is not specific. For example it can start with the extrusion either of a rectangle or a circle. I have solved that problem using iLogic and depending on the option on the form I suppress either the rectangle or the circle.
Another problem which I have not solved is the following: There is a sketch inside my part which has a spline. The spline is defined by some points. The points's number is not specific. They user might input 5 or 10 or 200. Therefore I cannot have many sketches created and suppress/activate them. I have to be able to create the points and give them the coordinates that the user inputs.
However as I undestood that cannot be done via iLogic
What I want to do is the following:
Automate the creation of a specific part. Because it is time consuming to do every time a new part I would like to have a form in which I will input some key values and via iLogic the part will be generated automatically.
The problem is that the part is not specific. For example it can start with the extrusion either of a rectangle or a circle. I have solved that problem using iLogic and depending on the option on the form I suppress either the rectangle or the circle.
Another problem which I have not solved is the following: There is a sketch inside my part which has a spline. The spline is defined by some points. The points's number is not specific. They user might input 5 or 10 or 200. Therefore I cannot have many sketches created and suppress/activate them. I have to be able to create the points and give them the coordinates that the user inputs.
However as I undestood that cannot be done via iLogic
Hi,
I have a part created through a multi body master part and as I create the component into an assembly, I would like to trigger a sketch on the face of a part created once I open the part.
Is it possible to trigger the "create sketch" using the iLogic when I open the part file. It is nearly similar to your rule but I like to pick the plane/face of the part in creating the sketch.
Hi,
I have a part created through a multi body master part and as I create the component into an assembly, I would like to trigger a sketch on the face of a part created once I open the part.
Is it possible to trigger the "create sketch" using the iLogic when I open the part file. It is nearly similar to your rule but I like to pick the plane/face of the part in creating the sketch.
Hi Eugene,
It may be doable via iLogic. But, you don't actually need to do it in iLogic. Go to Tools -> Application Options -> Part -> Sketch on New Part Creation -> select an origin plane -> Ok.
Many thanks!
Hi Eugene,
It may be doable via iLogic. But, you don't actually need to do it in iLogic. Go to Tools -> Application Options -> Part -> Sketch on New Part Creation -> select an origin plane -> Ok.
Many thanks!
Hi,
Thank you for your reply.
This option only works when you're opening a new part template. It doesn't work with part created through a multi-body part.
ie. multi-body part --> make component --> target new/existing assembly --> new part created
As it opens the target assembly you can now open the parts created. Once open I would like to trigger the iLogic to sketch on a face of the part or prompt me to sketch.
Hi,
Thank you for your reply.
This option only works when you're opening a new part template. It doesn't work with part created through a multi-body part.
ie. multi-body part --> make component --> target new/existing assembly --> new part created
As it opens the target assembly you can now open the parts created. Once open I would like to trigger the iLogic to sketch on a face of the part or prompt me to sketch.
Have you been able to resolve your problem? I'm trying to do something similar...
Have you been able to resolve your problem? I'm trying to do something similar...
Hi Eazyrider,
I haven't got the answer for it yet but I'm still searching for it.
Hi Eazyrider,
I haven't got the answer for it yet but I'm still searching for it.
Hi
Have you considered iFeatures?
These can be ultimately be driven via forms and iLogic?
I use them a lot for start parts, they save me heaps of time.
Setup and design can be a learning experience and sometimes a PITA, takes me a while to get them just right.
Hi
Have you considered iFeatures?
These can be ultimately be driven via forms and iLogic?
I use them a lot for start parts, they save me heaps of time.
Setup and design can be a learning experience and sometimes a PITA, takes me a while to get them just right.
Can't find what you're looking for? Ask the community or share your knowledge.