cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Create import feat error

itrepkus
2-Explorer

Create import feat error

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?

7 REPLIES 7
sjuraj
15-Moonstone
(To:itrepkus)

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);

itrepkus
2-Explorer
(To:sjuraj)

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.

sjuraj
15-Moonstone
(To:itrepkus)

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.

itrepkus
2-Explorer
(To:itrepkus)

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.

sjuraj
15-Moonstone
(To:itrepkus)

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.

itrepkus
2-Explorer
(To:sjuraj)

If I have multiple part step file (step file of assembly) how do I add it to part mode?

sjuraj
15-Moonstone
(To:itrepkus)

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.

Announcements
NEW Creo+ Topics: Real-time Collaboration


Top Tags