Code Red > AutoLISP (Vanilla / Visual)

Reading a chart

(1/2) > >>

ronjonp:
How would I begin to read values from a selected Excel column file based on 2 user inputs in lisp?

Enter Pipesize: 1

Enter Flow: 3

And this would extract 0.87 and 0.14.....




Thanks,

Ron

whdjr:
Check out David Stein's website DSXCad and another link on his site leads to some excellent excel and visual lisp Topics.

CarlB:
You might also consider doing the calculations for velocity and psi loss in the lisp routine.  The equation for velocity is simply flowrate divided by the cross-sectional area.  The pressure loss has a little more to the calculation but is not too lengthy.  You would need some data stored in the routine, such as actual pipe diameter given the nominal pipe size.

StarGazer:
But... is there a way of doing a lookup like this between Autocad and Excel? I can think of a few tables that I have in Excel that I would like to automate with lisp or vba.

Thomas

SPDCad:
You could use a multi-level condition;


--- Code: --- (cond ((= PIPE .75)
(cond (= FLW 1)(etc...) );
     (= FLW 2)(etc...) );
     (= FLW 3)(etc...) );
     etc.
        );
      );end cond pipe=.75
      ((= PIPE 1)
(cond (= FLW 1)(etc...) );
     (= FLW 2)(etc...) );
     (= FLW 3)(etc...) );
     etc.
        );
      );end cond pipe=1
      ((= PIPE 1.25)
(cond (= FLW 1)(etc...) );
     (= FLW 2)(etc...) );
     (= FLW 3)(etc...) );
     etc.
        );
      );end cond pipe=1.25
);end cond

--- End code ---


You could right a lisp if you were daring that would read a ‘csv’ which you generate with excel and have the lisp retrieve the data file (‘csv’) and look up the data you need based on the input you receive. If you are familiar with the formulas in excel, then you have the basic principals to setup a similar lisp programme. {ie. @vlookup(Cell,Data range, column)}
I have just  completed a lisp that looks up the equivalent window manufactures windows based on a generic size I have already specified. The lisp allows me to specify a specific manufacture for my plans based on the client I have.

Navigation

[0] Message Index

[#] Next page

Go to full version