Mon, 04/25/2022 - 14:39
The logs in console:
*** ERR StepReaderData : Unresolved Reference : Fails Count : 1 ***
** Model Complete Check List **
Check: 1 -- Global Check
Parameter n0.7 (authorisation) not a quoted String
Check: 2 -- Entity (n0:id) 1:#10 Type:DIMENSIONAL_LOCATION
Parameter n0.4 (shape_aspect_relationship.related_shape_aspect) not an Entity
Check: 5 -- Entity (n0:id) 15:#24 Type:GEOMETRIC_ITEM_SPECIFIC_USAGE
Parameter n0.4 (item_identified_representation_usage.used_representation) not an Entity
Check: 6 -- Entity (n0:id) 16:#25 Type:GEOMETRIC_ITEM_SPECIFIC_USAGE
Parameter n0.4 (item_identified_representation_usage.used_representation) not an Entity
Check: 7 -- Entity (n0:id) 145:#154 Type:REPRESENTATION_MAP
Parameter n0.2 (mapped_representation) not an Entity
Check: 8 -- Entity (n0:id) 146:#155 Type:REPRESENTATION_MAP
Parameter n0.2 (mapped_representation) not an Entity
Check: 9 -- Entity (n0:id) 147:#156 Type:REPRESENTATION_MAP
Parameter n0.2 (mapped_representation) not an Entity
Check:10 -- Entity (n0:id) 148:#157 Type:REPRESENTATION_MAP
Parameter n0.2 (mapped_representation) not an Entity
Check:11 -- Entity (n0:id) 149:#158 Type:REPRESENTATION_MAP
Parameter n0.2 (mapped_representation) not an Entity
Check:12 -- Entity (n0:id) 150:#159 Type:REPRESENTATION_MAP
Parameter n0.2 (mapped_representation) not an Entity
Check:13 -- Entity (n0:id) 151:#160 Type:REPRESENTATION_MAP
Parameter n0.2 (mapped_representation) not an Entity
Check:14 -- Entity (n0:id) 152:#161 Type:REPRESENTATION_MAP
Parameter n0.2 (mapped_representation) not an Entity
Check:15 -- Entity (n0:id) 388:#397 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:16 -- Entity (n0:id) 390:#399 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Mon, 04/25/2022 - 15:09
//STEPCAFControl_Reader Reader; // Old Code
STEPCAFControl_Reader Reader(XSDRAW::Session()); //New Code,but call error
Tue, 04/26/2022 - 10:52
The messages are all about unrecognized entities. This seems like to be a problem about STEP version. You should check the part about the STEP version setting and sort of things.
Reading from and writing to STEP
As for the code, I check the head file of this class STEPCAFControl_Reader There are two construct functions.
the first parameter of the 2nd construct function has to be a pre-defined object. So, this will work.
粗略看了一下。你这个文件好像是STEP版本问题吧,读入的时候OCC报出的信息都是显示文件中的某一个STEP entity,在STEP->OCC这个映射里面没有。就是说OCC不能对这个实体做映射,parse成OCC内部的数据。 在OCCT的overview,读写STEP文件那里有这个相关内容。 Reading from and writing to STEP
看了一下这行代码 STEPCAFControl_Reader Reader(XSDRAW::Session()); //New Code,but call error 似乎这个类的只有两种构造函数。 STEPCAFControl_Reader (); STEPCAFControl_Reader (const Handle< XSControl_WorkSession > &WS, const Standard_Boolean scratch=Standard_True); 第二个构造函数的说明要求第一个参数是已经存在的。这样写是ok的。
Tue, 04/26/2022 - 10:58
I sent a bilingual answer just now, was informed that it has to be moderated. So, typing a new one.
1.Messages are all about unrecognized entity. Seems like to be a problem about STEP version. You may check this page for mroe infos. Reading from and writing to STEP
2.The construct function with parameters of this class STEPCAFControl_Reader requires the first parameter to be an already existing obejct.
So, this will work.
and are you a Chinese studen?
Wed, 04/27/2022 - 04:33
hhhhh,首先十分感谢回复。不容易啊,终于等到回复了,感觉找到组织了。 我19年毕业的,从学校就一直搞CAD/CAE二次开发。之前搞的3DE/CATIA。现在在一家目标工业4.0公司工作,OCC是技术路线之一。 有联系方式不,[手动狗头],mail:moodlee@qq.com 一个一个回复哈。
First
The step file is exported by UG NX 2007, and the protocol is AP242. My code is:
Step Version? Do you mean :
Interface_Static::SetIVal("write.step.schema", 5);
? So Read step version isInterface_Static::SetIVal("read.step.schema", 5);
?Second
Demo Code:
Press F5 to Debug:
Tue, 04/26/2022 - 12:43
The Define:
So
Same with
Wed, 04/27/2022 - 10:51
LOL I’m new to the OCCT, too. What I replied formerly is wrong, and sorry for that! Actually I don't really know how to use the class STEPCAFControl_Reader, I just thought that might work. So I replied and don't run it on my pc. My apology!
I try to read your file with STEPControl_Reader, and get the same messages as you.
However, I don't know how to initialize the STEPCAFControl_Reader.
I tried codes below to initialize this class
the variable stat turns out to be IFSelect_RetVoid
the PrintCheckLoad() shows the message below
However, if I use the STEPControl_Reader 's data member to initialize the class, it will get the same as use the STEPControl_Reader to read the file directly.
Tue, 04/26/2022 - 12:45
I sent a bilingual answer just now too....
waiting....
Do you have any contact methods? My mail is moodlee@qq.com
Tue, 04/26/2022 - 19:39
STEP translation log specifies that dimension is attached to "not an Entity". So either, STEP document is broken (doesn't conform to standard) or OCCT doesn't handle some allowed combination.
Wed, 04/27/2022 - 04:43
hi~~~Thanks for your reply.
I understand what you mean, but the step file is exported by UG.
Will they not comply with AP242 specifications?
It's bad news.
However, are there some methods to solve the problem?
If there is a solution, thank you very much.
Wed, 04/27/2022 - 08:42
I don't know if STEP file is valid or not - for this, you need to read STEP standard and check the places, where OCCT parser shows complains / doesn't read. The price of another software cannot tell straight ahead if it writes standard-conforming or non-conforming files. If you cannot solve the problem on your own, you may use support services / register bugs on Bugtracker, so that experts will be able to take a look.
Wed, 04/27/2022 - 09:41
Thanks for your advice.
I will take into account.