Inventor Customization

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

iLogic Variable Transfer

449 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
Posts: 949
Registered: ‎02-24-2009
Message 2 of 29 (423 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: 31
Registered: ‎10-28-2010
Message 3 of 29 (418 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: 31
Registered: ‎10-28-2010
Message 4 of 29 (417 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
Posts: 949
Registered: ‎02-24-2009
Message 5 of 29 (409 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: 31
Registered: ‎10-28-2010
Message 6 of 29 (407 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: 31
Registered: ‎10-28-2010
Message 7 of 29 (406 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
Posts: 949
Registered: ‎02-24-2009
Message 8 of 29 (404 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: 31
Registered: ‎10-28-2010
Message 9 of 29 (402 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: 31
Registered: ‎10-28-2010
Message 10 of 29 (365 Views)

Re: iLogic Variable Transfer

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

Any news on this?

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube