Inventor Customization

Inventor Customization

Reply
Contributor
13 Posts
0 Kudos
Registered: ‎09-06-2012
Post 1 of 2

Using VBA to get vector for minimum distance between two parts

337 Views, 1 Replies
01-25-2014 03:55 PM

Does anyone know where is a good start for me to find out the following:

 

I need to automate the measuring of distance between two parts in an assembly and return or print the vector (deltaX, deltaY, deltaZ) values.  It will be looped around 20 times as an assembly constraint parameter value increases incrimentally. for example:

 

for i = 1 To 20

   ModelParamter.Item("d5").Value = ModelParamter.Item("d5").Value + 'Incriment'

   'code for measuring and "Debug.Printing" the

   'vector values from the measurement of minimum

   'distance between two specific part occurances in my assembly

   Next

 

I know how to inrement a parameter value in VBA, but i don't know how to return the vector for minimum distance between two parts.

 

Inventor 2011.

ADN Support Specialist
636 Posts
103 Kudos
Registered: ‎03-26-2007
Post 2 of 2

Re: Using VBA to get vector for minimum distance between two parts

01-30-2014 03:22 AM in reply to: kperic777

Hi,

 

Here is the article I wrote about this: http://adndevblog.typepad.com/manufacturing/2014/01/vector-of-minimum-distance.html

 

I hope this helps.

 

Cheers,



Adam Nagy
Developer Technical Services
Autodesk Developer Network
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post