Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Problem when importing STEP file into CATIA - Assembly combined into one PART & PARTBODY

Status
Not open for further replies.

nainh

Automotive
Nov 9, 2022
10
0
0
MY
Catia_STP-import-issue_pysyck.png


Hi pals, I am having an issue with importing STEP file consisting of an assembly into CATIA. It will always show the whole as one single PART, and every actual 'parts' of the assembly as PARTBODY. This makes it difficult to move things around/snapping.

Is there something I can do differently:
A) When saving STEP file from other software (but this would be sometimes beyond my control as some files were from clients)
B) When opening/importing STEP file from CATIA (perhaps there's a setting to control how I import files?)
C) Accept this fact & maybe there's a quick way to convert the hundreds of PARTBODY to PART? Any tips?

It's been really time consuming to work with STEP files when this happens, I really appreciate if you have any guidance![bigears]
 
Replies continue below

Recommended for you

Hi.

I have two macros that are making this for me. As we have customized part numbers and sometimes vendors/suppliers give us irregular part numbers and weird names I use a rename macro that numbers every body from 1 to X (the last). After that I have a part-to-product macro I can run on this catpart with renamed bodies.
The only downside is you have to rename all your bodies for your desires, or you can twinkle the macro to not rename them or get the filename in a different way.

The end result is a CATProduct with CATParts inside but they all contain the imported dead geometry from the STEP file.
 
Hi,
I found this script to convert a CATpart with bodies to a CATProduct, but I didn't test it.

Code:
'------------------------------------------------------------
' Makroname = KopyPARTtoPRODUCT.CATScript
'
'
' Author: 	Filippo Gozza
' Version:	V5R10, V5R12
'------------------------------------------------------------
' Konvertiert ein CATPart in ein CATProduct
' Alle Körper werden in CATPart's konvertiert
'------------------------------------------------------------

Language="VBSCRIPT"

Dim KomponenteNeu As Products
Dim KoerperName
Dim OpenKoerperName
Dim productDocument1 As Document
Dim Koerper  As Object
Dim QuellFenster As Window
Dim Letztekoerper
Dim UserSel As Selection


Sub CATMain()

	Dim Activdocu As Document
	
	'---------------------------------------------------
	' Neue Product
	'---------------------------------------------------
	Dim PosString As Long

	PartName = CATIA.ActiveDocument.Name

	Dim docu As Documents
	Set docu = CATIA.Documents

	Dim productDocu As Document
	Set productDocu = docu.Add("Product")
	
	Dim ProductNeu  As Product
	Set  ProductNeu = productDocu.Product

	PosString = InStr(1, PartName , ".CATPart")
	ProductNeu.PartNumber = Mid (PartName , 1 , PosString -1 )
	'------------------------------------------------------

	FensterNebeneinander()

	Set QuellFenster = CATIA.Windows.Item(1)
	QuellFenster.Activate

	Set Activdocu = CATIA.ActiveDocument
	Set productDocument1 = Activdocu.Part.Bodies

	Dim koerperAnzahl
	koerperAnzahl = productDocument1.count

	for i =1 to koerperAnzahl

		Set Koerper =  productDocument1.Item(i)
		KoerperName = Koerper.Name

		'Koerper kopieren
		Activdocu.Selection.clear
		Activdocu.Selection.Add Koerper
		Activdocu.Selection.Copy
		Activdocu.Selection.clear

		'Part erzeugen und Koerper einfuegen
		Dim PartNeu As Product
		Set PartNeu =  ProductNeu.Products.AddNewComponent("Part", KoerperName )

		' Fenster mit neue Product activieren
		ProductNeu.Parent.Activate

		' Alle Parts suchen
		PartSuchen(ProductNeu.Parent)
		
		ProductNeu.Parent.Selection.Clear
		ProductNeu.Parent.Selection.Add  UserSel.Item(Letztekoerper).Value
		ProductNeu.Parent.Selection.Paste
		ProductNeu.Parent.Selection.Clear
		
	next

	' Product actualisieren
	ProductNeu.update

End Sub


Sub PartSuchen(oPartDoc1)
	Dim E As CATBSTR
	Dim Was (0)
	Was(0) = "Part"

	Set UserSel = oPartDoc1.Selection
	UserSel.Clear

	'Let us first fill the CSO with all the objects of the model
	UserSel.Search( "CATPrtSearch.PartFeature,all" )

	E = Selection.SelectElement2 ( Was, "Alle CATPart wählen", true )
	Letztekoerper = UserSel.Count

End Sub


Sub FensterNebeneinander()

	Dim windows1 As Windows
	Set windows1 = CATIA.Windows

	windows1.Arrange catArrangeTiledVertical

End Sub

Hope it can help

Regards
Marc
 
Status
Not open for further replies.
Back
Top