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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Drive notebook parameter from excel

VINAYSINGH
6-Contributor

Drive notebook parameter from excel

Hello to all !!!

 

I want to link my excel data to notebook parameter & using notebook i want to drive my assembly model.

 

Is it possible using VB ?

 

if yes then please share me some example.

 

In Notebook module "Excel analysis" is disable. is there any options to enable it?

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
dnordin
15-Moonstone
(To:VINAYSINGH)

Vinaysingh,

 

You can export your existing relations first into a text file (old.txt), run your Excel analysis & generate the additional relations (new.txt), and then merge the two text files together before importing them into the Creo Parametric relations editor.

 

You can use the CMD/DOS "copy" command to merge the two files together.
The syntax is simple: copy old.txt+new.txt result.txt

 

If you don't want the users editing the relations that you generate via the Excel analysis, you can add comment lines into the relations as well.  Something along the lines of:

 

/* Begin Excel generated relations.
/* Do NOT edit the following relations.  They are generated via an external program.
MYPARAM1=55.3
MYPARAM2=YES
MYPARAM3="YES"
/* End Excel generated relations.

 

Using the comments at the beginning and end of the Excel generated relations section also has the added benefit of allowing you to easily remove the section either manually or automatically via a simple script.

 

Regards,

 

Dan N.

View solution in original post

3 REPLIES 3
dnordin
15-Moonstone
(To:VINAYSINGH)

I'm not aware of any way to enable the Excel analysis inside of notebook.

 

There is a way inside of the relations dialog to run a "c" program.  If you can read values from a native Excel spreadsheet directly with a "c" program, that may provide a method of driving a notebook value from the spreadsheet.

 

Another method would be to have the Excel spreadsheet export a .txt file in a format that can be imported into the relations dialog to drive your notebook values.  This should be simple enough to automate in Excel.

 

The format of the .txt file is simple as well.
MYPARAM1=55.3
MYPARAM2=YES
MYPARAM3="YES"

 

MYPARAM1 is a real value
MYPARAM2 is a logical value (yes/no)
MYPARAM3 is a string value

 

The importing of the relations file can be mapkeyed for semi-automation.

 

Regards,

 

Dan N. 

VINAYSINGH
6-Contributor
(To:dnordin)

Thank you so much for you reply @dnordin.

But when I import the .txt file it delete my existing relations also.

How can I overcome this problem ?
dnordin
15-Moonstone
(To:VINAYSINGH)

Vinaysingh,

 

You can export your existing relations first into a text file (old.txt), run your Excel analysis & generate the additional relations (new.txt), and then merge the two text files together before importing them into the Creo Parametric relations editor.

 

You can use the CMD/DOS "copy" command to merge the two files together.
The syntax is simple: copy old.txt+new.txt result.txt

 

If you don't want the users editing the relations that you generate via the Excel analysis, you can add comment lines into the relations as well.  Something along the lines of:

 

/* Begin Excel generated relations.
/* Do NOT edit the following relations.  They are generated via an external program.
MYPARAM1=55.3
MYPARAM2=YES
MYPARAM3="YES"
/* End Excel generated relations.

 

Using the comments at the beginning and end of the Excel generated relations section also has the added benefit of allowing you to easily remove the section either manually or automatically via a simple script.

 

Regards,

 

Dan N.

Top Tags