Help combining Macro and Ilogic

Help combining Macro and Ilogic

Anonymous
Not applicable
667 Views
4 Replies
Message 1 of 5

Help combining Macro and Ilogic

Anonymous
Not applicable

I had a macro that exported dxf's of all the sheet metal parts in an assembly marked with the Vendor or the Category as "Laser"  and I have an edited version of the Ilogic found on https://clintbrown.co.uk/2018/10/07/automatic-drawings-with-ilogic/  so it works in 2018.  I was trying to make the macro run the Ilogic on all the correct parts but can only get it to partially work.  

 

The "RuleForDrawing" Ilogic is the one that is set to run after open instead of the "Create Drawing" like in the link.

0 Likes
Accepted solutions (1)
668 Views
4 Replies
Replies (4)
Message 2 of 5

JamieVJohnson2
Collaborator
Collaborator

Hey Erik, 

You gotta tell us what the specific issue/error is.  "I can only get it to partially work"  is a bit vague. 

Does the code throw errors?

What partially works, what does not?

Does it stop somewhere?

Is there a particular file it keeps failing on?

These kind of answers help us to find your actual issue, because its not easy to find it in reading just the code (which I did read, but nothing stands out like a sore thumb).

 

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
0 Likes
Message 3 of 5

chandra.shekar.g
Autodesk Support
Autodesk Support

@Anonymous,

 

Can you please provide reproducible steps and files(template drawing, part.txt and partno.txt) to test the behavior? Please make sure that files are non confidential.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 4 of 5

Anonymous
Not applicable

I figured out the problem, it created a folder called TempPath instead of TEMP so after I changed that everything worked fine.  However,  I'm trying to find a code to auto scale the drawings so I don't have to select a scale for hundreds of drawings and found this forum: https://forums.autodesk.com/t5/inventor-customization/automatic-scale-and-view-position/td-p/5784680  I keep getting an error saying: 

Error in rule: Test, in document: TAY004-E101-I604_A .dwg

The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)) 

and the More info says:

System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at Inventor.DrawingView.set_ScaleString(String )
at LmiRuleScript.Main()
at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)

Just to clarify I'm running the rule by itself on the already created drawing.  If anyone could help with this or knows of a different rule to scale drawings I would really appreciate the help.

0 Likes
Message 5 of 5

chandra.shekar.g
Autodesk Support
Autodesk Support
Accepted solution

@Anonymous,

 

In mentioned forum link, user is using prerequisite to run iLogic rule. There are 5 views considered to automate views in a sheet.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes