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!
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!
@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
@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
@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.
@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.
@Anonymous
Can you share the error messege? it would probably gives us an idea where we're lacking.
@Anonymous
Can you share the error messege? it would probably gives us an idea where we're lacking.
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!
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!
Can't find what you're looking for? Ask the community or share your knowledge.