×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Exp formatting for String varibles

Exp formatting for String varibles

Exp formatting for String varibles

(OP)
UG NX 5
Windows XP 64-Bit w/Excel 2007

I am importing .exp files into UG using a journal file to create a large amount of drawings. I have done this successfully with other product lines but now I need to import a few string variables into the model. The problem is, UG seems to be adding extra double quotes around my variable when it imports. In the .exp it looks like this:

(String) Part_Number="12500130"

However I get an error from UG like this:
"(String) Part_Number=""12500130"""

If I remove the double quotes from the .exp like so:
(String) Part_Number=12500130

Then UG will import the value as 12500130 just fine but being that there aren't and quotes around it, the value does not update in the drawing. Am I formatting something wrong in the .exp or is there some type of manipulation I can do once the value without quotes gets imported into my expressions?

Thank you,

Jake Clever

RE: Exp formatting for String varibles

Why are you loading this string information into the Expression system?  Why no create Part Attributes instead?  They can also be linked to Notes on a drawing.

Also how do you know that the notes on your drawing which are linked to the expressions are NOT updating?  Have you tried selecting...

Tools -> Update -> Update for External Change

...to force an update?

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
UG/NX Museum:   http://www.plmworld.org/p/cm/ld/fid=209

To an Engineer, the glass is twice as big as it needs to be.
 

RE: Exp formatting for String varibles

(OP)
John,

The journal loads a different .exp file for each of about 10,000 drawings. I load the dimensions this way so I thought it would be easier to just load my part number and type using the same exp file. The type is really the issue because it is letters like "STD", "BEVEL", and "SQB". In the expressions table, the formula column updates when I import without quotes but the value column does not because it needs quotes to be a string. I was able to import the 3rd atribute as a constant to solve part of my problem but the other 2 are still not working.

Thanks for your help,

Jake

RE: Exp formatting for String varibles

Well I didn't use a journal, but if I MANUALLY import an .exp file containing expressions formated as follows...

(String) part_no="12345"

(String) part_name="test_part"


...I had not problems with them coming across as valid String Expressions.

Note that I tested this using NX 5.0.6.3

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
UG/NX Museum:   http://www.plmworld.org/p/cm/ld/fid=209

To an Engineer, the glass is twice as big as it needs to be.
 

RE: Exp formatting for String varibles

(OP)
There must just be something wrong with my syntax somewhere between the macro writing the .exp and the journal importing. This confirms that I can atleast import as strings using .exp's.

Thanks for your help John!

 

RE: Exp formatting for String varibles

(OP)
John,

I decided to try your manual method to import a string to start my troubleshooting. This is lies with the file format that I am using in excel. When I save my .exp I am using a Tab Delimited Text file format. However, this format does not like quotations. It adds additional quotations in a manner that matches the error I am getting in UG. Can you help me out by telling me how you are saving your .exps?

Thanks again!

RE: Exp formatting for String varibles

Your original post didn't say anything about Excel files.  Rather, you stated that you're importing files using the .exp file, which is a simple text file.  Exactly what is your workflow?

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
UG/NX Museum:   http://www.plmworld.org/p/cm/ld/fid=209

To an Engineer, the glass is twice as big as it needs to be.
 

RE: Exp formatting for String varibles

(OP)
I appologize for not being more thorough. I have created a macro in VBA to create a large number of .exp files by bringing data in from a master data sheet containing all the dimensions, filenames, and materials for each part. I store these exp files in a folder that the journal in UG pulls from on each iteration of code. I can export an exp and then import it back in just fine. However, if I open that same exp file in excel and save it without any changes, it will not import. So I assumed I was saving the exp in the wrong text format.

I hope this helps,
Thanks John

RE: Exp formatting for String varibles

This appears to be Excel behavior and as such I have no way of knowing how to change it.  Perhaps someone could write some sort of script/macro which could export the data and then remove the redundant quotes (").

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
UG/NX Museum:   http://www.plmworld.org/p/cm/ld/fid=209

To an Engineer, the glass is twice as big as it needs to be.
 

RE: Exp formatting for String varibles

(OP)
That's what I thought as well but before I did that I went through to try each "text" file type I could and opened them in notepad to see the output. I found that saving as a Formatted Text (Space Delimited) .prn file type allowed me to keep the quote formatting the way I wanted. Now it imports strings and numbers perfectly.

Thanks again for your help,
Jake

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources