×
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

Automate Drawings from Spreadsheet
2

Automate Drawings from Spreadsheet

Automate Drawings from Spreadsheet

(OP)
I have been trying to automate a process of making around 2000 drawings with dimensions in an excel spreadsheet. I have a master template but need to change a few dimensions in each drawing.I have tried to use part families but I can not effeciently generate drawings using this method. Is there a better way to import/link the spreadsheet data to these parts?

Jake Clever
Product Engineer

RE: Automate Drawings from Spreadsheet

Are we talking about changing the dimensions of a model and then have the drawing update accordingly or are we trying to directly drive the text in dimensions on a drawing?

And what version of NX are you using?

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.com/museum/

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

RE: Automate Drawings from Spreadsheet

(OP)
I would like for the dimensions of the model to change and save a .pdf for each iteration from the spreadsheet.

I am using version 5 but have version 7.5 capability if there is a newer function to make this possible.

RE: Automate Drawings from Spreadsheet

If your real 'ouput' in merely the 2000 PDF's, perhaps it might be better to create a template model with an imbedded drawing (there are situations where Master Model may not always provide any advantage, with this example being one of them) and then write an NX Open application which would open the template part, read the relevant expression value(s) from an external Spreadsheet, update the model and drawing, export a PDF and then optionally save a copy of the current manifestation of your template part giving it a new name (which could also have been read from the Spreadsheet) if it was important to actually have a copy of each of the 2000 manifestations saved on disk.  If not, then just read another set of records, update, export the PDF and continue until all 2000 records have been read and the 2000 PDF files have been created and saved.

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.com/museum/

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

RE: Automate Drawings from Spreadsheet

Attached is a sample program which demonstates coding for the procedure outlined by JohnRBaker.

Included is a part file (model1.prt) which is NX7.5 part.  This part has a simple block in it and a drawing with two dimensioned views of the block.

The xls data for three versions of the block are included in data1.xlsx.  The program looks for this xls file in C:\temp\

To read the xls file we need to use a Microsoft namespace.  This means the program cannot be run as a journal.  I have included the source code (PDFCreate.txt).  Just change the txt extension to vb for reference.  The pdfcreate.dll has been signed so that the sample program can be run (NX7.5).

Frank Swinkels

 

RE: Automate Drawings from Spreadsheet

(OP)
Frank,
   Thank you for the sample program. I tried to execute it but it came back with an error, most likely due to something I am doing despite your efforts. I appologize for that. I have attached a picture of what I am getting back from NX when I execute the program as an NX open.

Thanks for all your help!

Jake Clever

RE: Automate Drawings from Spreadsheet

I think what may have been missing from your system is the Microsoft.Office.Interop.Excel.dll file (I think).  What I have done is included the above file.  I have also changed the code so that it looks for this library in C:\temp.  Please place this file also in C:\temp.  I have also added two error checking.  

Hope this now works.

Frank Swinkels

RE: Automate Drawings from Spreadsheet

(OP)
The application is still stopping at the excel open with the msgbox you sent up. I am trying to edit and rebuild but without much luck.

RE: Automate Drawings from Spreadsheet

(OP)
I am using office 12.(2007) Still no luck. I will try some modifications and possibly do a read from excel with it opened manually.

Thank you for all your help!

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