Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X
Hello,
I'm trying to import step file into my creo session. However my program shows error:
System.Runtime.InteropServices.COMException: pfcExceptions::XToolkitUnsupported
at pfcls.IpfcSolid.CreateImportFeat(IpfcIntfDataSource _IntfData, Object _CoordSys, Object _FeatAttr)
When running a line:
impFeat = solid.CreateImportFeat(sourceData,DBNull.Value,DBNull.Value)
Where
impFeat is IpfcFeature
sourceData is IpfcIntfDataSource with type EpfcINTF_STEP
What might cause this problem and maybe you have any tips on how to solve it?
You have to create stp-file representing object:
IntfDataSource ids = pfcModel.IntfStep_Create("c:\path\to\file\step.stp");
then do import to solid:
solid.CreateImportFeat(ids, null, null);
I haven't added full code, but object sourceData does exactly that. It is created with lines:
Dim impStep As IpfcIntfStep
Dim sourceData As IpfcIntfDataSource
impStep = (New CCpfcIntfStepClass).Create(stdPath)
sourceData = impStep
impFeat = solid.CreateImportFeat(sourceData,DBNull.Value,DBNull.Value)
And on the line where I want to create import feat it throws exception.
I cand code in VB, but I think there could be syntax mistake: (New CCpfcIntfStepClass).Create(stdPath) - there is unclosed parenthese. However exception is thrown later. Make sure your path is good.
With a little bit of work I found out in Document - CS210230 on support.ptc.com that functionality for adding features from step file was disabled. Maybe someone know where I could get better information or example of opening step file with my code? Open step file and saving it as prt file would be enough of a guidance for me.
Yeah, but this is only for assembly mode. There is no limitation in part mode. My posted code works well. You can still use string sequence and run it as macro if your tries will loose again.
If I have multiple part step file (step file of assembly) how do I add it to part mode?
It no matter if a step is part or asm. You can import asm-step as part and creo will merge these parts to single one but creo can crash your assembly while merging therefore is good to import assemblies as assembly but j-link not even creo do not allow you to import step in assembly mode. However you can create macro which will open your step file and import the file as asm.