AutoCAD Inventor :: ILogic / Use Same Variable In Multiple Subs / Functions?

Apr 10, 2013

I have an iLogic rule in which I'm trying to set three user parameters for the gage of each leg of a steel angle. I want Inventor to set the gage based on the length of each leg. Here's the table I referenced for gages: [URL].

In my code, I have a sub called DetermineGage which takes the leg length, whether it's the short leg or the long leg, and determines the gages that should belong to that leg. Inside of that sub it calls on a sub called ApplyGage which then applies the determined gage to the rule's gage variables. The main sub then grabs those variables and applies those values to the actual user parameters.... In theory.

The rule executes ok with no errors, but doesn't change the value of the user parameters; they're always "0". As best I can tell, the "oGage" variables I used in the rule don't even get assigned the correct value, which makes me think the DetermineGage and ApplyGage subs can't even access the oLegLength or oGage parameters to read or set them. I don't want to use global parameters because I've heard that can make programs very unstable over time and is just bad practice. How can I make these variables accessible to all subs IN THIS RULE, no more no less?
 
Sub Main()Dim oLegShort As Double = Min(G_W,G_H)Dim oLegLong As Double = Max(G_W,G_H)Dim oLegLength As DoubleDim oGage As DoubleDim oGage1 As DoubleDim oGage2 As Double'Short Leg:oLegLength = oLegShort'Call DetermineGages sub to set oGage variables:DetermineGages()On Error Resume Next'If gage parameter does not equal true gage, set it equal:If Parameter("ShortLegGage") <> oGage ThenParameter("ShortLegGage") = oGageEnd If'Assume error means gage parameter does not exits. Create and set equal to true gage:If Err.Number <> 0

[code]...

View 9 Replies


ADVERTISEMENT

AutoCAD Inventor :: Very Slow ILogic Functions With Multiple Processes?

Mar 22, 2013

how the internals of Inventor / iLogic are working.

We have multiple instances of Inventor running on a 12 core workstation so we can push configurations through concurrently  - each Inventor instance is assigned its own processor affinity and each instance has its own project which points to seperate directories of Inventor models.

Everything seems to work OK when there are up to 5/6 working concurrently, but as soon as there are more than 6 the iLogic functions seem to grind to a halt - note that the rules are external rules.
 
For example, this function took 11 seconds to complete when there were 10 concurrent orders processing. :
 
Parameter("BLANK", "EDGE_FRT_ACTIVE") = "YES"
 Similarly these functions took 11 seconds in total to complete :
 
iProperties.Value("Custom", "M1110900_P1PO") = iProperties.Value("Custom", "BLANK_GDIM") - iProperties.Value("Custom", "PANEL_GDIM")iProperties.Value("Custom", "M1110900_P2PO") = iProperties.Value("Custom", "BLANK_XGDIM") - iProperties.Value("Custom", "PANEL_XGDIM")iProperties.Value("Custom", "M1110900_P1OR") = 1iProperties.Value("Custom", "M1110900_P2OR") = 0
 
When I run these with less that 6 concurrent Inventor processes, they're are almost instant.

I just don't know where the bottleneck is. I've ruled out :

- Processor (each core never reaches above around 60%)

- RAM (we've got 48GB of RAM, with about 15GB free at worst)

- Disk (disk IO is busy, but it doesn't look like it's the bottleneck)

- Graphics (Inventor is in silent mode, with no UI, so graphics activity is minimal)

From the tests I've done it seems to be the iLogic functions that are the bottleneck. My next port of call is to change the iLogic functions to actual API calls, but I suspect I'll get the same results.

So, my questions :

Is Inventor queing these iLogic API calls somehow (note we're creating a unique instance of the Inventor.Application COM object for each processing thread) ?

Is there an issue with using external rules with nultiple instances?

Dell Precision R5500, Intel Xeon X5690 3.47GHz (x2)
48GB RAM
Inventor 2013 (PDS Premium)
64bit Windows 7 SP1

View 4 Replies View Related

AutoCAD Inventor :: Prebuild Functions For Calculus In ILogic?

Jul 3, 2012

 Are there any prebuild functions for Calculus in ilogic.

View 2 Replies View Related

AutoCAD Inventor :: ILogic Calculating Math Functions (Tan / Sin / Cos) Incorrectly

Sep 2, 2013

ilogic is calculating tan/sin/cos/aTan/aCos/aSin incorrectly. E.g.
 
MessageBox.Show(Atan(35))
Answer = 0.4738... when it should be 0.7002....

View 5 Replies View Related

AutoCAD Inventor :: Suitable ILogic Functions For Part Template?

Oct 4, 2011

I am working on creating a new part file Template. Any useful and productive iLogic functions those are already available.

A while ago, I had seen one that would simply triger when part was checked in or saved. It would check if the material feild was utilzed or forgotten at Default.

share if there are any good iLogic functions that we might benefit from.
 
C1
Inventor Professional 2013
Vault Collaboration 2013

View 2 Replies View Related

AutoCAD Inventor :: List Of ILogic Commands / Syntax Functions

Sep 6, 2013

I used to have an A1 printed sheet of all of the ilogic commands, functions, syntax or whatever you call them.  It was all nicely grouped and colour coded etc

Unfortunately I have since moved jobs and lost this and neither me or google can find this again, any copy or link?  it may have been a pdf or excel format.

View 3 Replies View Related

AutoCAD Inventor :: Property File Subtype In ILogic Functions Not Recognized

Aug 28, 2013

I need to use the property " File Subtype" for programming a function in logic, but inventor not recognise this property.

I use this function "If iProperties.Value("Project","File Subtype")=Sheet metal"

How i can do for use this property for a ilogic function?

View 3 Replies View Related

AutoCAD Inventor :: ILogic - Defining Variable In Name

Nov 16, 2011

I'm an Inventor 2011 user and I'm writing a Ilogic script to update an assembly. For this I want to use a variable in a name.

For example d1 till d10 will be given the value 25.

Is it possible to define "d" combined with a variable "n" . The script should be something like this:

n=1

for n<11

dn=25

n=n+1

end

View 3 Replies View Related

AutoCAD Inventor :: Pass Variable From VBA To ILogic Rule?

Sep 20, 2011

We are using Inventor 2011.

I have found a rouind about way to display document thumbnails in VBA in 64 bit windows 7 inventor.

The only piece of the puzzle I am missing is for a way to push a document object or a document file name into an iLogic Rule from VBA. 

Below is a 64 bit thumbnail solution for VBA sans the input.

Essentially I am launching an iLogic Rule from VBA that pushes an inventor document object into a VB.NET dll.

The dll converts the iPictureDisp into a VB.NET image object, reduces the size then converts it into a byte array.

The byte array is passed back to VBA through the same iLogic Rule.

Once the byte array is received it is converted back into an iPictureDisp object.

' ----------------------------------------

' --- VBA Project Form Code ---

' ----------------------------------------
Option Explicit
Private Sub Command1_Click()
End Sub

' -------------------------------------------

' --- VBA Project Module Code ---

' -------------------------------------------
Option Explicit
Public Sub SetPic(ByRef bBuffer() As Byte)
Set UserForm1.Pic.Picture = PictureFromRes(bBuffer)
End Sub

[Code]....

View 9 Replies View Related

AutoCAD Inventor :: Get Environment Variable To Run External ILogic Rule

Sep 17, 2012

I tried to read an environment with iLogic and to combine it with an external rule name and to pass the whole path over to iLogicVB.RunExternalRule.

StrPath = Environment.GetEnvironmentVariable("ILOGIC_DIR")ilogic_rule = "IPT__01_New_Document_EXT.iLogicVb"rule = StrPath & ilogic_rule'MessageBox.Show(rule, "iLogic Rule to execute")iLogicVb.RunExternalRule(rule)

The message box shows the correct path, but I allways receive a error massage:

'GetEnvironmentVariable' is not a member of 'Inventor.Environment'

View 3 Replies View Related

AutoCAD Inventor :: 2013 Crashes When Using Multiple Functions

Mar 25, 2013

I have been using this software for a few months now, and I continue to have crashing issues. The issues, however related, are not consistent. I tend to have issues when using more complex applications of the software such as crashes when performing a breakout view, freezing and then many times crashing when manipulating a part within an assembly drawing, and several other similar issues. I have received an update SP1.1 (176) and installed it. This update states it contains a fix for issues of crashing due to excessive memory consumption.

I have 6GB of RAM, nVidia Quadro FX 3800 1GB graphics card, Intel Core i7 920 2.66GHz processor, and updated drivers... 

View 9 Replies View Related

AutoCAD Inventor :: How To Get Subs LOD To Update

May 16, 2012

I have a fuel tank assembly and created a subs lod for use in the top level assembly.

I changed the length, width and height of the tank body.  The assembly is fine but the subs LoD isn't updating properly.  I have tried rebuild all from both the tank assembly and the top level assembly.  Even if I open the subs derived part I cant get it to update. 

View 2 Replies View Related

AutoCAD Inventor :: ILogic To Save Multiple Formats

Mar 1, 2013

I have the following

strFile = ThisDoc.FileName(False) & "-Rev " & iProperties.Value("Project", "Revision Number")ThisDoc.Document.SaveAs(strFile & (".dwg"), True)ThisDoc.Document.SaveAs(strFile & (".pdf"), True)

And it works like a charm for pdf, but it does not export to .dwg?

And also, is it possible to decide where in the name the "-Rev " &iPro....should appear?

Ex. if the filename should be : "12345 - Rev 02 - Section cut"

View 1 Replies View Related

AutoCAD Inventor :: ILogic Form With Multiple Forms?

Oct 25, 2012

I would like to know if it is possible to make a form with multiple forms, depending on the selection a could build a rectangle, or a cilynder or a cone.

View 3 Replies View Related

AutoCAD Inventor :: Multiple Identical ILogic Sub-assemblies With Different Parameters

Jul 17, 2013

iLogic code question concerning how Place iLogic Component and retain the ability to push parameters from the subassemblies to the parts after being renamed.

I have ASSEMBLY.iam containing:

SUBASSEMBLY-01:1.iam
SUBASSEMBLY-02:1.iam
and sometimes SUBASSEMBLY-02:2.iam

each SUBASSEMBLY.iam contains PART1.ipt and PART2.ipt which have variable LENGTH and WIDTH. LENGTH and WIDTH are entered manually at the SUBASSEMBLY.iam and are infinitely variable.

To transfer the parameters I'm using iLogic code in the SUBASSEMBLY:

 Parameter("PART1.ipt", "LENGTH")=LENGTHParameter("PART1.ipt", "WIDTH")=WIDTHParameter("PART2.ipt", "LENGTH")=LENGTHParameter("PART2.ipt", "WIDTH")=WIDTH
 
Issue 1: When I place the SUBASSEMBLY as an iLogic Component, the parts are renamed to PART1-01.ipt which renders my Parameter transfer useless. What am I missing on writing this code so it can find the new part name?

 Issue 2: I like the automatic renaming that happens with Place iLogic Component. Is there a better way to handle this automatically through Place Component -> Save & Replace?

Inventor 2013

View 1 Replies View Related

AutoCAD Inventor :: Create Listbox In ILogic That Allows For Multiple Selections?

Oct 3, 2013

How do I create a listbox in iLogic that allows for multiple selections?

View 3 Replies View Related

AutoCAD Inventor :: Copy ILogic Rule To Multiple DWG Files

Feb 14, 2012

I have the need filter inside Vault the Inventor Drawings (.dwg/.idw) by its papersize.

In my testing enviroment, I created a iLogic rule inside a .idw with the following

iProperties.Value("Custom", "Formato") = ActiveSheet.Size

I used the Ruler Trigger "After Save Document" to refresh this rule.

In Vault, I've mapped this custom property:

But, how to Copy (and update) this iLogic Rule to the other existing .dwg files in Vault?

I thought the iLogic Design Copy would be able to do so, but it doesn't works in that way.

View 6 Replies View Related

AutoCAD Inventor :: ILogic Replace Component With Multiple Different Components

Jan 5, 2014

So I have been going round and round in circles on this one iam trying to use replace component within ilogic which is fine with switching one part for another but I want a drop down of parts so it replaces which ever one is active the problem I am having is establishing which one is active. So below is what I have so far but the problem is you cant seem to reference a part that is not in the assembly so I keep getting the error

The component named "Flange 1" was not found for example. I just need a way of establishing which one is currently in the assembly but with out referencing components that are not there.

If Component.IsActive("Flange 1")=True Then current = 1
If Component.IsActive("Flange 2")=True Then current = 2
If Component.IsActive("Flange 3")=True Then current = 3
If part = 1 And current = 2 Then Component.Replace("flange 2", "Flange 1.ipt", True) End If
If part = 1 And current = 3 Then Component.Replace("flange 3", "Flange 1.ipt", True) End If
If part = 2 And current = 1 Then Component.Replace("flange 1", "Flange 2.ipt", True) End If
If part = 2 And current = 3 Then Component.Replace("flange 3", "Flange 2.ipt", True) End If
If part = 3 And current = 1 Then Component.Replace("flange 1", "Flange 3.ipt", True) End If
If part = 3 And current = 2 Then Component.Replace("flange 2", "Flange 3.ipt", True) End If

View 4 Replies View Related

AutoCAD Inventor :: ILogic - Assembly Rule To Multiple BOMQuantity In Parts

Oct 9, 2013

I have used Inventor for quite a while but never for much more than the odd 3D model.

I have recently created templates that allow me to use Inventor to create detailed fabrication drawings rather than relying on AutoCAD. But I have run across a question with regards to the BOM. Let me try and explain my issue.

I currently create assemblies for fabricated items. However, in the complete (or top level assembly) there may be multiple fabricated items (assemblies required). At the moment I create the BOM and manually edit the quantities required to reflect the number of assemblies (and resulting parts) that are required.

In my assembly file I created a parameter called "AssemNo" which is meant to reflect the number of assemblies required. In my part files I created a parameter called "AssemQty". I would insert the following iLogic code for each part in the assembly:

quantity - This.BOM.CalculateQuantity("Model Data", "PartNumber")*AssemNo
Parameter("Part Name:1", "AssemQty") = quantity

This works but it requires me to create that line of code for every part in my assembly. I know an iLogic code can be created to search an assembly and change parameters of all parts (see below as an example to copy Occurence name to iProperties >

' set a reference to the assembly component definintion.
' This assumes an assembly document is open.
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition

'Iterate through all of the occurrences
Dim oOccurrence As ComponentOccurrence
For Each oOccurrence In oAsmCompDef.Occurrences
    Dim oName As String
    oName = oOccurrence.Name
    iProperties.Value(oOccurrence.Name, "Project", "Part Number") = oName
    MessageBox.Show(oOccurrence.Name, "iLogic")
Next

Can the two be combined?

View 3 Replies View Related

AutoCAD VB :: DVB File - Subs Do Not Work

Sep 15, 2011

R2006

We have a .dvb file that we load on startup.

It does some things on the begin save event.

When I bring up the VBAIDE, I can see the few subs that do the work but what I'm wondering is:

Is there or can there be other code within the .dvb file that I'm not seeing in the AutoCAD VBIDE?

In other words, it there the possibility of some other compiled code inside the .dvb that does things in the background that isn't visible in the code window?

View 9 Replies View Related

CorelDRAW X6 :: How To Make A Button Do Multiple Functions

Jun 6, 2013

How do you make a button do multiple functions....?

Example:

1. Clicking button multiple times to do something different. Example: for practice.

* Click Once for one action

* Twice for another

Again... Then back to original..And or, add a Hold shift option to do function? Is this complicated?

View 14 Replies View Related

AutoCAD Inventor :: Close ILogic Form With VBA Or ILogic Rule

Aug 19, 2013

how can I close an iLogic Form from either an iLogic Rule, or a VBA Rule (VBA is the Preferred method)?

View 5 Replies View Related

AutoCAD Inventor :: Trigonometric Functions Not Working In Parameters

May 6, 2013

In my Parameter equation dialog box: "cos(.5)" is red"(.5)" is black.

Does Excel need to be installed for Trigonometric functions (I don't have Excel)?

View 2 Replies View Related

AutoCAD Inventor :: Use User Selectable Browser For All Related Functions?

Jun 17, 2011

Is it possible to use a user selectable browser for all related functions?

I'd like to see the possibilty to select with which webbrowser Inventor interacts.

Currently the wikihelp opens in my default browser (Google Chrome), but the help function and subscription links open in Internet Explorer.

View 3 Replies View Related

AutoCAD Inventor :: Preserve Functions In IProperties When Accessing With VBA Script

Dec 3, 2012

I made a simple dialog to access some of the iproperties. This is quite handy when working on a drawing of a part, but there is one flaw with this script. If the part's description has a function referencing the parts dimensions for instance, when my script gets the description it gets the plain text and not the formula. Meaning if the part's description is "=<d0> X <d1> X <d2>" and appears as "1 X 2 X 3" the script will get "1 X 2 X 3" and when it resaves the description it will over write the formula with plain text.

Is it possible to get the formula so my script could display that for editing instead of the plain text?

Below is a part of the code I'm using and it's the standard code I've seen for retreiving ipropterties.

Dim invDoc As Document Set invDoc = ThisApplication.Documents.ItemByName(GetToken(PartList.Value, 3, Chr(1))) Dim invDesignInfo As PropertySet Set invDesignInfo = invDoc.PropertySets.Item("Design Tracking Properties") Dim invProperty(1 To 4) As Property Set invProperty(1) = invDesignInfo.Item("Part Number") partnumber.Value = invProperty(1).Value Set invProperty(2) = invDesignInfo.Item("Description") description.Value = invProperty(2).Value

View 1 Replies View Related

Photoshop :: Batch Process Single Or Multiple Files Using Variable Effects

Jul 28, 2012

Is it possible to take 3-4 effects, all mixed together, like brush stroke, solarise, warp sharp, neon... mix them all together, and process a number of pictures while changing the mix level of each effect, and also varying some of the effect settings, such as brush size, brightness, etc...

are there any scripts that can do that? any macro plugins that can control other plugins? is there a crafty programming trick that could be fashioned to vary and mix effects across a task of batch processing?

View 3 Replies View Related

AutoCAD Inventor :: Variable Spiral Thickness

Oct 20, 2011

Is there a way to use the coil command to make a spiral out of a rectangle where the thickness of the rectangle starts at one value and ends at another? This would be a spiral torsion spring with decreasing thickness approaching the center.

View 5 Replies View Related

AutoCAD Inventor :: How To Pass Variable From One Addin To Another

Aug 25, 2013

I've used vb.net to write two separate addins.  I was wondering if there is a way to pass a variable from one addin to another similar to the way shared variables are passed from rule to rule in iLogic.

View 2 Replies View Related

AutoCAD Inventor :: How To Create Helix With Variable Section

Sep 25, 2013

how to create an helix with variable section?. The axis diameter is constant.

View 3 Replies View Related

AutoCAD Inventor :: Apply Variable Pressure To A Surface With FEA

Feb 16, 2012

If I enter the Stress Analysis Environment in 2012, I can apply pressures to surfaces, but what if the pressure varies (eg, with height as it does in a tank holding a fluid). Is it possible to apply a variable pressure to a surface with Inventor's FEA? It doesn't seem like it, I also searched this forum and the net, couldn't find anything. Usually one can enter an equation, that also doesn't work.

View 3 Replies View Related

AutoCAD Inventor :: Variable Radius Going Wrong Direction

Sep 6, 2012

Trying to apply a variable radius to a part. The direction of the radius is wrong (pointed back in toward the part) and I cant get it to go the other way.  As long as all the fillets along the curve are the same radius, the fillet will compute, but if I make them vary, then it fails.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved