Inventor Customization

Inventor Customization

Reply
Active Contributor
OkieWolf
Posts: 35
Registered: ‎10-28-2010
Message 1 of 29 (463 Views)

iLogic Variable Transfer

463 Views, 28 Replies
02-16-2011 12:39 PM

I have a rule which contains the Main and three Subs. I need to transfer variables between Subs. Normal VB doesn't seem to work. It doesn't error out. It just doesn't do it.

 

For example, I call a Sub from Main :

SwapPipe (oCompOcc, CurrentSize, NozzleSize)

 

The Sub beginning looks like :

Sub SwapPipe(compOcc as Inventor.ComponentOccurrence, CurrentSize As String, NozzleSize As String)

 

Then that Sub calls another Sub as:

InitialSize(compOcc, CurrentSize)

 

And that Sub beginning looks like:

Sub InitialSize(ScompOcc as Inventor.ComponentOccurrence, CurrentSize As String)

 

So, as an example, I would think that the variable CurrentSize would transfer between all these. But it isn't.

 

Any help is greatly appreciated.

Employee
MjDeck
Posts: 959
Registered: ‎02-24-2009
Message 2 of 29 (437 Views)

Re: iLogic Variable Transfer

02-18-2011 06:58 AM in reply to: OkieWolf

That should work.  What version of Inventor are you using?

You can try adding the line:

Option Explicit On

and maybe

Option Strict On

to the top of your rule.  That might give you some compiler error messages about undeclared variables.

 

 



Mike Deck
Software Developer
DLS - Mechanical Design
Autodesk, Inc.

Active Contributor
OkieWolf
Posts: 35
Registered: ‎10-28-2010
Message 3 of 29 (432 Views)

Re: iLogic Variable Transfer

02-18-2011 08:02 AM in reply to: MjDeck

Inventor 2011 64bit.

OS = Windows 7.

 

I agree it should work but there are lots of things I've found in iLogic that you can do in Dot Net but not in iLogic.

 

But variable transfer is simple and I just can't understand why it won't do it.

Active Contributor
OkieWolf
Posts: 35
Registered: ‎10-28-2010
Message 4 of 29 (431 Views)

Re: iLogic Variable Transfer

02-18-2011 08:26 AM in reply to: OkieWolf

I added Option Explicit On, but didn't get anything useful returned.

Employee
MjDeck
Posts: 959
Registered: ‎02-24-2009
Message 5 of 29 (423 Views)

Re: iLogic Variable Transfer

02-18-2011 10:45 AM in reply to: OkieWolf

Can you post the complete rule?  That would help me to figure out what's going on.

 



Mike Deck
Software Developer
DLS - Mechanical Design
Autodesk, Inc.

Active Contributor
OkieWolf
Posts: 35
Registered: ‎10-28-2010
Message 6 of 29 (421 Views)

Re: iLogic Variable Transfer

02-18-2011 10:54 AM in reply to: MjDeck

I can but I think I may have found a way around it. I'm now trying to eliminate the subs, condense down the code, and just put it all in the main.

Active Contributor
OkieWolf
Posts: 35
Registered: ‎10-28-2010
Message 7 of 29 (420 Views)

Re: iLogic Variable Transfer

02-18-2011 10:57 AM in reply to: OkieWolf

I do have another question. Are you the one that wrote the external rule for the Content Center replacer for iLogic?

Employee
MjDeck
Posts: 959
Registered: ‎02-24-2009
Message 8 of 29 (418 Views)

Re: iLogic Variable Transfer

02-18-2011 11:07 AM in reply to: OkieWolf

Yes, I can take credit or blame for that code.



Mike Deck
Software Developer
DLS - Mechanical Design
Autodesk, Inc.

Active Contributor
OkieWolf
Posts: 35
Registered: ‎10-28-2010
Message 9 of 29 (416 Views)

Re: iLogic Variable Transfer

02-18-2011 11:12 AM in reply to: MjDeck

Ok, good. I'm using it in my current program.

 

Basically I have a 150# nozzle which consists of a 150# flange and a pipe. Both are Content Center parts. I can swap the flange out without issue but I'm having difficulty with the pipe. How do I put that in the replacer command so that Content Center knows to ONLY replace the size and leave the schedule and length alone?

 

Then, secondary to that, how do I  put that in the replacer command so that I can change any of those?

Active Contributor
OkieWolf
Posts: 35
Registered: ‎10-28-2010
Message 10 of 29 (379 Views)

Re: iLogic Variable Transfer

02-21-2011 07:08 AM in reply to: OkieWolf

Any news on this?

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.