Creation sketch with VBA iLogic

Creation sketch with VBA iLogic

jeeva.scientist
Enthusiast Enthusiast
3,463 Views
27 Replies
Message 1 of 28

Creation sketch with VBA iLogic

jeeva.scientist
Enthusiast
Enthusiast

1) Creating a sketch with construction lines. The parameters are "circle_small" , "circle_large" and "c2c".
sketch creation with Hidden linessketch creation with Hidden lines

 2) Now chords are drawn by using the previous sketch as the path. In the end, there will be a gap which is to be filled with the same chord. now the "c2c" dimension can be converted into a driven dimension.

chord drawin with certain dimension along the path of the sketchchord drawin with certain dimension along the path of the sketch

 3) The gap in the previous sketch is filled with a chord by converting the "c2c" as driven dimension.

gap in the previous sketch is filled with the same chord length by changing the "c2c" as driven dimensiongap in the previous sketch is filled with the same chord length by changing the "c2c" as driven dimension

 

how to create this using iLogic VBA?

Input Dimension

circle_small

circle_large

c2c

chord

 

Changes

c2c can be converted into the driven dimension to adjust the gap.

 

Can anyone help me with the program?

 

I have attached my part file.

kindly find the attachments, thanks.

 

Inventor Version 2020

 

0 Likes
Accepted solutions (2)
3,464 Views
27 Replies
Replies (27)
Message 2 of 28

andrew_canfield
Collaborator
Collaborator

First impression, is the Roller chain calculator helpful (Assembly. design, power transmission)?

0 Likes
Message 3 of 28

jeeva.scientist
Enthusiast
Enthusiast

Actually what I have explained is just a simplifaction of my real problem. I am planning to use this as my idea to do my real work. Hoping to create a below-attached chain bucket elevator assembly.

final work of my problemfinal work of my problem

 

0 Likes
Message 4 of 28

HideoYamada
Advisor
Advisor

Hello,

 

I always make a model of chain by using Pattern Component.

Capture.PNG

Yes, this is fake. The two links around the corner are not connected correctly(= at the joint pin).

But I think this method is enough to explain that how the machine works.

 

The model in above picture is attached to this post.

 

Is this way not enough for you? (You want to model exactly?)

 

=====

Freeradical

 Hideo Yamada

 

=====
Freeradical
 Hideo Yamada
https://www.freeradical.jp
Message 5 of 28

Sergio.D.Suárez
Mentor
Mentor

Hi. Here I share a model that I have made a few years ago, it is a chain model that is updated by changing the distance between the centers of the chain. Use ilogic and formulas. I am sure that now it could be improved much more, but I attached the idea for you to observe. You must work with functions in the equations such as ceil and floor to round the measurements to your necessary value as an integer. In the arcs you should make the division with respect to the step in order to calculate the angular displacement.

I hope this helps. regards


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

0 Likes
Message 6 of 28

jeeva.scientist
Enthusiast
Enthusiast

I am afraid, I want the exact model. Actually I have created this manually and its 100% ok. But ill be doing this repeatedly for various values (more than 70 variations). so ill be so happy if what I am asking could be done using iLogic or VBA or API anything.

I have attached the model that I have an assembly with accurate alignment.

Thanks for your support.

 

Attachment version: Inventor version 2015

 

0 Likes
Message 7 of 28

Sergio.D.Suárez
Mentor
Mentor

It has an embedded excel table where it extracts the parameters according to the type of chain used. The rules are too simple. Maybe if he did the same job today he would look for another approach and not load the excel table, he would load the data in the same ilogic rule.


I hope this can be useful


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

Message 8 of 28

jeeva.scientist
Enthusiast
Enthusiast

I am afraid, I want the exact model. Actually I have created this manually and its 100% ok. But ill be doing this repeatedly for various values (more than 70 variations). so ill be so happy if what I am asking could be done using iLogic or VBA or API anything.

I have attached the model that I have an assembly with accurate alignment.

Thanks for your support.

 

Attachment version: Inventor version 2015

0 Likes
Message 9 of 28

jeeva.scientist
Enthusiast
Enthusiast

I am ok with the idea of embedding excel with the inventor but still, the data in the excel is created manually. As per my original question if we can create the chord with respect to the path given. we can use the chord path with a rectangular pattern to create points and then use it in assembly. I know its a bit of work but I don't know iLogic programming. the method I am suggesting is the simplest and most efficient I have tried several I have been working on this for over a month to make it as simple as possible.

 

I have attached the model that I have an assembly with accurate alignment.

Thanks for your support.

 

Attachment version: Inventor version 2015

0 Likes
Message 10 of 28

Sergio.D.Suárez
Mentor
Mentor

My advice would be to forget about creating patterns in the sketches. This is not efficient and will bring you too many headaches. Try to edit a linear pattern easily in a sketch and modify it for example, you will encounter difficulties with the relationships of the patterns. Try to think in your model that there are circular and linear patterns of operations or even solids. This is much more efficient. You may have a more elaborate design tree in your browser, but I assure you that the method is more efficient and error free. (I make this same recommendation for example with sketch fillets, I prefer to avoid them and create features of fillets external to the sketch, selecting their respective geometry edges). The recommendation of a sketch would be to load the maximum possible information, but in a clear and simple way, avoiding the use of sketch patterns, fillets and duplicating entities unnecessarily. Grettings


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

0 Likes
Message 11 of 28

jeeva.scientist
Enthusiast
Enthusiast

Let me try and get back to you ASAP. Thanks for your response.

0 Likes
Message 12 of 28

jeeva.scientist
Enthusiast
Enthusiast

Hello Mr.Serigo,

Thanks for your response, I have considered your suggestion of using "linear and circular pattern". There is no issue in using the "linear pattern" but, when we use "circular pattern" while giving the distance between two instances, which in our case is the pitch. In a "circular pattern", the pitch distance is considered as an arc length, not as a chord length. so the chain link will interfere with one another it will not be accurate.

 

How can I solve that problem?

I’m eager to receive your feedback, thanks.

0 Likes
Message 13 of 28

adam.nagy
Autodesk Support
Autodesk Support

You mention both VBA and iLogic in the title so I guess you're fine with both.

iLogic is just a wrapper on top of the Inventor API and it does not seem to have much functionality around Sketches, so you'd have to rely on the underlying Inventor API.

 

You can find many samples for each of the things you need, and then you could put them together.

- Create a Sketchhttp://help.autodesk.com/view/INVNTOR/2018/ENU/?guid=GUID-D75B8EBD-DBA2-4358-A907-5DACAC7F0815

- Create Sketch geometry and Constraintshttp://help.autodesk.com/view/INVNTOR/2018/ENU/?guid=GUID-92268986-6A83-42DA-AC4B-121E76638E09

 

If you're new to Inventor API programming then probably the easiest is to get started with it in the VBA environment where you can debug into your code and check variable values.

 

In the VBA environment, you can also investigate the various objects you created in the UIhttps://adndevblog.typepad.com/manufacturing/2013/10/discover-object-model.html

 

I hope this helps.



Adam Nagy
Autodesk Platform Services
Message 14 of 28

jeeva.scientist
Enthusiast
Enthusiast

Thanks for your suggestion, I'll try this and get back to you soon. For the record, I am totally new to iLogic, API and to programming. I hope this will help me in the long run.

0 Likes
Message 15 of 28

HideoYamada
Advisor
Advisor

Hello jeeva,

 

You should consider the difference between the pitch circle and the locus of the joint pins.

In the first drawing you posted, two arcs at both ends are locus of the joint pins.

In my fake model, I treated them as pitch circles of the sprockets.

 

To calculate the length of chain (or number of links), we have to think about the pitch circle (PCD).

Some connections between adjacent links are broken in my fake model, but the distance of the sprockets and the number of links are same as actual created machine.

=====

Freeradical

 Hideo Yamada

 

=====
Freeradical
 Hideo Yamada
https://www.freeradical.jp
0 Likes
Message 16 of 28

jeeva.scientist
Enthusiast
Enthusiast

Hello Mr.HideoYamada,

Can you send the "fack model" that you designed to let me see? it will help me understand the things you explained. if that's ok. thanks.

0 Likes
Message 17 of 28

HideoYamada
Advisor
Advisor

Hi,

 

The model is attached to the 4th message of this thread.

 

=====

Freeradical

 Hideo Yamada

 

=====
Freeradical
 Hideo Yamada
https://www.freeradical.jp
0 Likes
Message 18 of 28

jeeva.scientist
Enthusiast
Enthusiast

Hello,

I am trying to create this model in industrial standard accuracy.

 

I have tried your model attached to the 4th message of this thread.

It seems like there are few misalignments because we used curved paths on the left and right side. which I have marked in the below image.

Picture1.png

 

To avoid such error i have used both the curves as a reference and created a straight line as the path. which I have shown below.

Picture2.png

 

Then I used the above sketch as a path to creating a pattern of work points. which I have shown in the below.

Picture3.png

 

Picture4.png

 

once the pattern is completed this pattern can be used as the reference pattern for the chain link.

Picture5.png

 

Picture6.png

 

The below image shows a 100% accurate of chain assembly.

Picture7.png

 

I have attached the wireframe view below for better understanding

Picture8.png

 

 

The output I am hoping to achieve is as accurate as of the above one.

  • Since the above assembly has just 18 links it is easy to do it manually.
  • For the record, the above one is not parametric assembly.
  • In my case, I will be assembling around 300 to 400 chain links, so it's hard to do it manually.
  • I'll be doing the same kind of assembly for more than 50 cases, so I am hoping to do this in fully parametric using API or iLogic.

I have attached the model for your reference, thanks to everyone for your time and guidance.

Autodesk Inventor 2015 Version:

 

0 Likes
Message 19 of 28

HideoYamada
Advisor
Advisor

Hello,

 

You should create the sketch that treats the arcs at both ends as pitch circles.

This sample is more better, but not perfect.

ca[ture.PNG

 

This model is attached to this message.

 

If you create the really, completely and exactly model,  the thing will become more complicated.

For example, the angle between two straight lines is constant in the sketch, but the angle of actual (physical) chain is not so.

The locus circles of joint pin are lager than corresponding pitch circle as shown in the picture above. As a result, the joint pin around the end of straight line may be placed at outside of the line.

 

Your drawing is looks like OK, but the links at the end of arcs may bite into the sprockets.

Yes, you can ignore this interference.

 

=====

Freeradical

 Hideo Yamada

 

=====
Freeradical
 Hideo Yamada
https://www.freeradical.jp
0 Likes
Message 20 of 28

HermJan.Otterman
Advisor
Advisor
Accepted solution

Hello Jeeve, here is my part (Inventor 2019),

 

it is not perfect, but works nice as long as you keep the steps small during change.

there is a iLogic form to change the parameters.

I hope this helps you a bit

 

If this answers your question then please select "Accept as Solution"
Kudo's are also appreciated Smiley Wink

Succes on your project, and have a nice day

Herm Jan