Custsom iLogic Print Function Error

Custsom iLogic Print Function Error

Jason.Rugg
Collaborator Collaborator
323 Views
4 Replies
Message 1 of 5

Custsom iLogic Print Function Error

Jason.Rugg
Collaborator
Collaborator

I have two machines, not physically identical, but are setup identically. I have a custom iLogic Print code that I run on each of them, one machine it works flawlessly on but receive an "error in rule" message when running the rule on the other. Below is the error I get, can someone possibly tell me why or what it's not liking?

 

Error Message:

Error in rule: 11 x 17 Print With Plot Stamp, in document: Drawing1
Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
 
More Info:
System.Runtime.InteropServices.COMException (0x80004005): Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
   at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
   at Inventor.PrintManager.set_Printer(String )
   at ThisRule.Main()
   at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
   at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)
0 Likes
324 Views
4 Replies
Replies (4)
Message 2 of 5

JamieVJohnson2
Collaborator
Collaborator

When I setup code to print to Excel I got similar errors, because I was sending the program the Printer Name, when the printer name was actually longer, such as HPLaserJet = HPLaserJet:OnNE1 or something like that.  Each PC used the printers base name, but then added a network connection port that potentially could be a different overall name.  So I had to use a search method (for each printer, check name, if name contains "HPLaserJet", then close enough...).  Since it is failing (E-Fail is inventor's way of saying I tried that and got an error back) at setting the printer, I would look into that first.

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

Jason.Rugg
Collaborator
Collaborator

Interesting, I will look into that, I don't expect that to be the issue though since the printers are installed on my machine.

0 Likes
Message 4 of 5

chandra.shekar.g
Autodesk Support
Autodesk Support

@Jason.Rugg,

 

As the iLogic code is working in one system, the error may be due to mentioning improper printer name. Please make sure that proper printer name is mentioned in iLogic code.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 5 of 5

Jason.Rugg
Collaborator
Collaborator

This is not the issue, I am using the proper printer name.

0 Likes