Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Threaded Holes with iLogic

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
dbcox
2314 Views, 5 Replies

Threaded Holes with iLogic

Hi,

 

I am using Inventor and Excel to create several parts automatically.  Most everything is driven directly by Excel through the parameter table, but since Inventor will not import tolerances, I am using iLogic to assign tolerances to those critical dimensions.

 

I am also having trouble with threaded holes through.  The parts have drilled and tapped holes.  I can easily assign a parameter to the drill and thread depth, but not the thread size/designation.  With some investigation, I discovered iLogic has the "ThreadDesignation" command.  The problem is, there are about 30 different threads it could be, depending on the part, so I cannot do a simple if then statement to determine which of a couple of options it would be.

 

I tried linking the thread designation through Excel, but Inventor will not import text...  I then tried to create the designation by importing the diameter, pitch, and 0 or 1 variable for UNC or UNF (using IF THEN to determine UNC or UNF), but had no luck there. So then I tried to link the Excel file using the GoExcel.CellValue command.  That worked, EXCEPT, it would only work once.  If the thread size changed in Excel, I would get an error saying a unit change isnt' allowed (although no units where changed).

 

Any help will be greatly appreciated.

 

David Cox

5 REPLIES 5
Message 2 of 6
mrattray
in reply to: dbcox

You could encode the thread into some arbitrary number and link that through Excel.

1) List on paper every possible thread (that's applicable to this) and assign them all an arbitrary number (1,2,3,etc.)

2) Link that value into Inventor along with your other parameters.

3) Use a select case statement to decode back to a real thread designation as a string variable.

4) Use the ThreadDesignation method to assign the thread callout.

 

If you don't like this idea (it is kind of crude) you could try the Inventor Customization forum as well.

Mike (not Matt) Rattray

Message 3 of 6
dbcox
in reply to: mrattray

Matt,

 

Thanks for the info!  I thought about that, and that is certainly doable.  However, I am pretty new to iLogic.  Can you elaborate on the "select case statement" and how I need to code it?  I assume it will lookup a value (the number parameter) in Excel and return the thread value.  But, I don't know how to code that.

Message 4 of 6
mrattray
in reply to: dbcox

Select case is just a more sophisticated form of If Then. It's better for big messy logic statements. Here's an example:

 

Sub ExampleSelect()

Dim test As Integer

test = 2

Select Case test
Case = 1
 'Do this if test = 1
Case = 2, 3
 'Do this is test = 2 or 3
Case Else
 'Do this if other conditions are false
End Select

End Sub



Sub Example IfThen()

Dim test As Integer

test = 2

If test = 1 then
'Do this if test = 1
ElseIf test = 2 Or test = 3 Then
'Do this if test = 2 or 3
Else
'Do this if other conditions are false
End If

End Sub

 

These two subs do exaclty the same thing, but one is a bit "wordier" than the other.

Mike (not Matt) Rattray

Message 5 of 6
dbcox
in reply to: mrattray

Mike,

 

Thank you for the quick reply!  Is there a way to pull in an Excel file to accomplish the same thing?  The issue is there are many, many possibilities, and we add to them regularly.  If I could just add to a "master" spreadsheet that Inventor could reference, I would be in a lot better shape.  Is that possible?

 

Thanks,


David

Message 6 of 6
dbcox
in reply to: dbcox

I figured it out!  It turns out the error I was getting about the unit change was NOT due to iLogic.  I had placed the text parameter in the same column as all of my dimensional values, which was causing the error!

 

I still wish Autodesk would allow the parameter table import text, especially now that text is allowed...

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report