Is a lisp routine a good choice for this

Is a lisp routine a good choice for this

jseefdrumr
Mentor Mentor
394 Views
3 Replies
Message 1 of 4

Is a lisp routine a good choice for this

jseefdrumr
Mentor
Mentor

Hi all, I work in ACAD Electrical 2015. My experience with LISP has mostly been limited to my old-school command macros. I am now faced with needing to create a 'real' customized program. My problem is that I'm not informed enough to know if LISP is my best choice here, or if I should look at VBA or something, so I'd like some advice.

 

Here is what I need:

1. to evaluate every occurence of a certain block and collect the value of one of its attribute definitions...across multiple drawings

2. to sort and tally up occurences of repeated values (ie, for value 100 tally is 4, value 150=5, etc.)

3. to discard any tallies that come out as 2 or less, if possible

4. to perform a simple mathematical calculation on each (T/2+1), with results rounded to nearest whole number if possible

5. to report these results in some way

 

My first question: is this even possible?

 

Second question: will it be difficult to do as my first true LISP routine?

 

I've been using ACAD in some shape or form since '02. I get along pretty well. I don't want anyone to write this for me, I want to do it myself, but I'm thinking I will need at least some broad strokes. I'm simply not experienced enough to know which commands might help me get what I need. Any help will be appreciated.

 

Thanks for any assistance!

 

Jim



Jim Seefeldt
Electrical Engineering Technician


0 Likes
395 Views
3 Replies
Replies (3)
Message 2 of 4

dgorsman
Consultant
Consultant

Yes, thats possible with LISP.  It could also be easiest with LISP, as using other methods would require some additional learning first.  Like everything else, if it sounds big start breaking it down into chunks.  If those chunks sound too complex break them down, and so on.  A couple of things to start researching:

 

  • ObjectDBX, for reading other drawings
  • lists, for managing the harvested data
  • functions to search and manipulate lists, such as (assoc ...) and (mapcar ...)
  • creating and writing to a text file (you'll probably be doing CSV output for simplicity)
----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


0 Likes
Message 3 of 4

jseefdrumr
Mentor
Mentor

Dgorsman,

 

Thanks for the reply. I've already started looking at some of your suggestions.

 

ACAD Electrical uses lots of data from attribute definitions to get things done. It stores this info in files, they usually take the form of .mdb or .xls. If I can locate the values I want in one of these files, can I extract it using LISP? That may be easier than evaluating all of the drawings.



Jim Seefeldt
Electrical Engineering Technician


0 Likes
Message 4 of 4

dgorsman
Consultant
Consultant

If these are actual block attributes, it will be much easier to extract them from the block instances.  Otherwise, you will need to mess around with connecting to MS Access or Excel (MDB and XLS) files, which can be very difficult with both the connection as well as understanding how the content is organized.

 

Don't forget to check the API for your application - it may have some additional information and tools.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


0 Likes