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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Translate the entire conversation x

Problem with cabling XML import file

GianLuca
4-Participant

Problem with cabling XML import file

Hi to all,

I have recently update my PTC product from Wildfire 5 to CREO 2. Until I have used Wildfire 5 I could import XML cabling file in Pro/E (from Zuken E3) with no problem. In Creo 2.0 when I try to import same file I receive an error about spools. In practice, CREO does not accept the separation character (ex. 0.5) of the spools. Infact if I modify manualy the XML file and change 0.5 in 0_5 the problem is solved.

So my questions are:

- how do I replace automatically "_" instead of "."?

- why in NWF file, the same spools with "0.5" is properly interpreted by CREO with no error?

Thanx

4 REPLIES 4
lsbv
3-Newcomer
(To:GianLuca)

hello to all ,

I have the same problem with the spools , but when importing the XML in creo 3.0 .

does anyone have a solution how to replace "_" with "." , in the XML/spools ?

Thx 

Hello,

 

We have exactly same issue :

- how do I replace automatically "_" instead of "."?

OR

- We request support for additional characters, especially "."

 

Regards

lsbv
3-Newcomer
(To:vschmaltz)

Hello ,

solution for me was to create a new spool database and rename the old spools :

BK-0.75-FLRY ==> FLRY_0075_BK ...f.e. 

 

B.R.

Lars_F
13-Aquamarine
(To:GianLuca)

Hi,

 

I believe the xml import restricted some characters a fairly long time ago. Documentation tells the following

 

In the Creo Schematics file, ensure that the parameters such as, spool_name, full_name, and term_name that are used to create feature names do not contain the following:
• Spaces
• Begin with “-“
• Characters such as !,”,£,$,%,^,&,*,( ), and . (dot) 
	
The limitations for these parameters are the same as the limitations for cable names.
However, the parameter names can contain the following characters:
• Letters
• Digits
• “_”
• “-“
• An ASCII character greater than 127

 

If the extended ASCII works (as the document claims) then you could replace the (.) with a bullet (149) or a middle dot (183)?

 

I would replace the . (dot)  with the underscore (_). You could write a simple python script to do this. Copilot suggest a following code example...

(replaces the . from spool name only). This sample may not work for your specific needs... We don't use the . (dot) on our spool library component names.

 

import os
import sys
import xml.etree.ElementTree as ET

# Function to replace dots with underscores in the name attribute
def replace_dot_with_underscore(file_path):
    # Parse the XML file
    tree = ET.parse(file_path)
    root = tree.getroot()

    # Iterate through all SPOOL elements
    for spool in root.findall('.//SPOOL'):
        # Get the name attribute
        name = spool.get('name')
        if name:
            # Replace dots with underscores
            new_name = name.replace('.', '_')
            # Set the new name attribute
            spool.set('name', new_name)

    # Write the modified XML back to the file
    tree.write(("output.xml"), xml_declaration=True, encoding='UTF-8' )

# Example usage
if len(sys.argv) != 2:
	print("Usage: python test.py <file_path>")
else:
	file_path = sys.argv[1]

	if os.path.exists(file_path):
		print("Converting File "+ file_path)
		replace_dot_with_underscore(file_path)
	else:
		print("File does not exist")

 

Br, Lars

 

Announcements
NEW Creo+ Topics: Real-time Collaboration

Top Tags