Cancel
Showing results for 
Search instead for 
Did you mean: 

Any method to paste formula?

Honored Contributor
Honored Contributor

Is there any way to copy and past forumula's into the variable in a way it understand what to do?

 

for example: If I could paste in the following

BA=PI()*A/180*(BendRadius+(MaterialThickness*NeutralFactor))

I would need that to happen in a way is understand to link up to the variables already in that file rather than the file the formulas were copied from.

 

The reason I ask, is that I have a set of about 20 formula that I am inputting into about 50 files. I would rather not have to type them in 50 times. Sure some typing is avoided by clicking on other variable names.

 

I have not found any method of saving and reusing formula's

 

10 REPLIES

Re: Any method to paste formula?

Gears Honored Contributor Gears Honored Contributor
Gears Honored Contributor

It does. I tested with the following:

Part1.par variables A=10, B=10, C=A+B

Part2.par variables A=50, B=50, C=Copy-Paste formula from Part1.par, Result C=100

 

Re: Any method to paste formula?

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

Hi @12GAGE

 Hi @Tushar

 

 

I already have a macro doing that.

 

I thought I also have posted it here in the forum.

It should be part of the main_dim macro

 

 

I will take a look when later being in the office

 

You can define everything in an INI/XML file and all variables are placed in Your file.

You also can define wether or not, those variabls should be exposed too.

 

 

regards
Wolfgang

Re: Any method to paste formula?

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

Hi Edgers,

 

Hi @12GAGE@Tushar

 

 

 

see attached macro SE_Expose.exe

Sorry for delate posting, but I first had to translate the INIs and setup files into English also the macro itself.

 

The use will be very easy (hope so)!

 

You will find to additional LST files (list files) with appropriate lines to define what You want to be in Your variable table.

 

The explanation in English tehre should be allow to use it.

 

  • in the file Expose.lst You can define those variables together with typ, formular, comment and even limits as You need them
  • the second list file is Units.lst where the definition of used units with used decimalplaces is defined.

The numbers I have used are taken out of the Solid Edge API handbook and the values used there.

I have saved the important page as UnitTypeConstants.pdf

 

 

Hope the macro will help You with Your requests

 

 

 

Edit: have forgotten to say:

Don't hesitate to further ask me here if there are any questions!

 

regards
Wolfgang

Re: Any method to paste formula?

Honored Contributor
Honored Contributor

The question is how to mechaniclly paste better.

 

The ONLY way I know how to copy formula right now is to have two copies of SE open with one file open each both with variables open. Then I must use right click and select copy. then go to the destination and right click and paste. Hotkeys don't work for some reason. One formula at a time only after I have typed in the variable name that is the result.

 

I would like to be able to copy and paste 20 formula at once, including the name of the variable result. IE the entire line from the variable table. Is there a way to at least copy the entire line rather than just the formula?

 

it's the most basic parts of this I'm trying to work out. Better than the slowest possible method of copy and paste one forula at a time.

 

I tried the macro, don't think it's working right. What type of file is lst. Is that another version of a txt file?

 

 

Re: Any method to paste formula?

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

Hi @12GAGE

 

 

 

those two list files (text files) are simply to open with any text editor.

These are plain text files with a couple of lines in it.

 

  • Expose.lst:

#
#definition of exposed variables or creating them
#
#the syntax for every line is following:
#variable name;unit typ (see list in PDF); formula if wanted;comment;limits (lower limit,condition, upper limit)
#limits syntax (according to SE) as following:
# 0 = no
# 1 = gretaer than
# 3 = greater equal
# 4 = lower than
# 12 = lower equal
# or the sum of above
# 1 (greater) + 4 (lower) = 5
# 1 + 12 = 13 = greater and lower equal
# 3 + 4 = 7 = greater equal and lower
# 3 + 12 = 15 = gretaer equal and lower equal

# example:
# variable ;typ ;formular ;comment ;limit
# color_percent;58 ;100 ;percentage of color ;50,15,150

#variables of this list will be exposed for further usage in BOM or draft header
# adapt according Your requirements

Materialstärke;1;
Biegeradius;1;
Ausklinkungsbreite;1;
Ausklinkungslänge;1;
Neutralfaktor;1;
Preis;58;2.5
Zeit;58;1.5
Stundensatz;58;50
Kosten;58;Preis+Zeit*Stundensatz
Masse;3

 

 

and

  • Units.lst

'
'definition of those units which will be used in Your document
'
'syntax:
'unit typ;unit;number of decimal places to use
'example
'13 = area ; 5 = m2 ; 2 = 2 decimal places
'56 = volume ; 11 = dm3 ; 2 = 2 decimal places
'16 = density ; 5 = kg/dm3 ; 3 = 3 decimal places
' 3 = mass ; 5 = kg
'45 = mass per length ; 5 = kg/m
'37 = velocity ; 2 = m/s
'35 = accelaration ; 2 = m/s2
'26 = force ; 3 = kN
'27 = stress ; 4 = MPa

13;5;2
56;11;2
16;5;3
3;5;2
45;5;2
37;2;2
35;2;2
26;3;2
27;4;0

 

not more

 

Just adapt to Your needs and it should work for You - and everybody else of course

 

regards
Wolfgang

Re: Any method to paste formula?

Honored Contributor
Honored Contributor

I figured out one, just ok, solution.

The formula can be typed directly into a spreadsheet. No = sign used

Then in the model file, you enter the result variable name, start the formula with =, then paste from the spreadsheet.

 

Now at least I don't need two copies of SE open, and I can have a central location with all the formula in it.

 

So the next step is figuring out how to copy and paste more than one  formula at a time.

Re: Any method to paste formula?

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

I don't get why you'd need two sessions of SE. If you have two part or assembly files open, open the variable table, don't close it, it changes as you tab between open files.

Bruce Shand
ST10 MP10 - Insight - Win10 - K4200

Re: Any method to paste formula?

Honored Contributor
Honored Contributor

I use two copies of SE so that I can have both variable tables open at the same time.

The way things need to be used is not canned or straight forward. Design work and desired result is part of process of copy and past formula's. 

 

In that way I can see both sets of algebra at one time to determine the next set of formula to copy and paste.

 

Working blind (Only have one set of algebra visible at the same time) forces the process to be more planned. The result is, it takes much longer to figure out what is needed.

 

Re: Any method to paste formula?

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

Makes sense.

Bruce Shand
ST10 MP10 - Insight - Win10 - K4200