iLogic insert ACAD to 3d sketch

iLogic insert ACAD to 3d sketch

Anonymous
Not applicable
540 Views
5 Replies
Message 1 of 6

iLogic insert ACAD to 3d sketch

Anonymous
Not applicable

Does anyone have iLogic code that will insert a AutoCAD drawing file (.dwg) into a 3D sketch? The drawing being imported has wires that extend into 3 dimensions. I was able to bring the drawing in as a 2D sketch using the Translator, but I cannot seem to figure out a way to bring it into the 3D sketch. Thank you!

0 Likes
541 Views
5 Replies
Replies (5)
Message 2 of 6

bhavik4244
Collaborator
Collaborator

@Anonymous 

 

you  may try this one, however, you might need to twick it as per your need.

 

https://forums.autodesk.com/t5/inventor-forum/ilogic-rule-to-insert-acad-to-sketch/td-p/6282683

 

 


Bhavik Suthar
0 Likes
Message 3 of 6

Anonymous
Not applicable

@bhavik4244 wrote:

@Anonymous 

 

you  may try this one, however, you might need to twick it as per your need.

 

https://forums.autodesk.com/t5/inventor-forum/ilogic-rule-to-insert-acad-to-sketch/td-p/6282683

 

 


Hi @bhavik4244 

I’ve looked at that post and tried modifying the planar sketch to Sketch3D and using an add Sketch3D function instead of adding the 2D sketch, however that code results in an error and an import of AutoCAD file as a drawing. Do you have any suggestions? I can paste the code I’ve been running that has that result if it would be helpful.

0 Likes
Message 4 of 6

bhavik4244
Collaborator
Collaborator

@Anonymous 

 

Can you share the error messege? it would probably gives us an idea where we're lacking.


Bhavik Suthar
0 Likes
Message 5 of 6

Anonymous
Not applicable

Hi @bhavik4244,

 

This is the error message I'm receiving:

Unable to cast COM object of type 'System.__ComObject' to interface type 'Inventor.PartDocument'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{29F0D463-C114-11D2-B77F-0060B0F159EF}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

 

And this is the text under the "More Info" tab:

System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Inventor.PartDocument'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{29F0D463-C114-11D2-B77F-0060B0F159EF}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
at ThisRule.Main()
at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)

 

Please let me know your thoughts, thank you again for the help!

0 Likes
Message 6 of 6

bhavik4244
Collaborator
Collaborator

@Anonymous 

 

@JarFu 

Can you please have a look?


Bhavik Suthar
0 Likes