Author Topic: Keyed Note Program?  (Read 2633 times)

0 Members and 1 Guest are viewing this topic.

MikeR

  • Guest
Keyed Note Program?
« on: December 15, 2005, 04:45:26 PM »
Hello, The company I work for we have been using this program for as long as I can remember
and it has been hacked on and tweaked over the years as we have upgraded autocad. We now
are currently making the jump from v2002 to v2006. This lisp is pretty bad shape and just doesn't
run as well or as fast as it should I think. When ran it looks for a block(-cap08) which can be
located on PS or in MS(visible only thru viewport), inserted in an XREF or multiple XREF's.
There is also a master txt file that has the corresponding value of the block with the description.
The program reads the master file and finds the right value or values if the block is inserted more
than once with a different value and builds a schedule that is sorted numerically by value on the sheet
in paper space. The dialog is used so that it can save defaults of where the txt is located, column depth, column width, text size

Could somebody maybe give it a look and give me some ideas.
I have attached the appropriate files.

Thanks

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Keyed Note Program?
« Reply #1 on: December 15, 2005, 08:51:24 PM »
Welcome to the Swamp Mike. :-)

Perhaps if you posted a sample drawing and matching text file for testing.
I am too lazy to recreate a working drawing to test the routine.

At first look there is nothing bad going on that I can see, just some things I
would do differently. But you will get differing methods from different programmers. :)

As for speed, there may be some time savings in the way the text files are handled.
Namely reading all from one. Then write all to the other. Not that that is a big deal
with todays systems.

The way the string data is handled in 'getdefaults' looks like it could be improved but
I would like to see the actual text file.
It is much faster to work with list than it is with strings.

In the DCL file I would have the user pick the directory to use not having to type it in.

Some area need updating, as an example I woud change the manualinput routine to this:
Code: [Select]
(defun manualinput ()
  (if (not quickrun)
    (progn
      (setq answer (getstring t (strcat "Keynote Library File Name <" lib1 ">:")))
      (if (/= answer "") (setq lib1 answer))

      (setq answer (getint (strcat "Column Depth in Inches <" cdep ">:")))
      (if (and (/= answer nil) (numberp answer) (> answer 0))
         (setq cdep (atoi (min answer maxdepth))
      )
     
      (setq answer (getint (strcat "Column Width in Inches <" columnwidth ">:")))
      (if (and (/= answer nil) (numberp answer) (> answer 0))
         (setq columnwidth (atoi (min answer maxwidth))
      )

      ;;  user may enter 80, 100 or 125 as keyword or right click will display the choices.
      (initget "simplex80b,80 simplex100,100 simplex125,125")
      (setq answer (getkword
                     (strcat "Text Style for Keynote Schedule [simplex80b/simplex100/simplex125] <"
                                (nth (atoi ctxt) ctxts)
                                ">:"
                      ))
      )
      (if answer (setq ctxt (vl-position answer ctxts)))
 
    )
  )
) ;end defun MANUALINPUT

<not tested> 8-)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

MikeR

  • Guest
Re: Keyed Note Program?
« Reply #2 on: December 19, 2005, 11:43:40 AM »
Cab,
Thanks for the response. I have uploaded a sample-dwg and a sample-xref which around here in the office we call a system plan.
In the drawing you will notice the schedule on a layer "g-anno-keyn" the program does not look for notes on that layer. Also there
is a layer in the xref called "e-lite-keyn-emer" which is frozen. On this particular sheet it is only looking for the blocks on layer "E-LITE-KEYN"
We have had some drawings that might have blocks place in model or paper as well as in the xref that we are looking for. I have detached
xrefs to save size like the real titleblock, roomnames and those type of xrefs. I am kindof hoping that I can get the program streamlined
a little bit where it maybe does not have to bind the xref and explode it to find the keyed note within the xref or xrefs
Thanks again.

MikeR

  • Guest
Re: Keyed Note Program?
« Reply #3 on: December 19, 2005, 11:54:24 AM »
Cab,
I forgot to send you the text file so here it is. Also on your comment on the DCL file That was what I was wanting to do but I could not
figure out how to get the dcl file to build the directory list. I have had alot of these guys complain when for some reason the program did
not save the defaults for the dcl and they have had to retype in the location of the text file.

Thanks again
Mike

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Keyed Note Program?
« Reply #4 on: December 19, 2005, 12:31:15 PM »
Got the files.
Not sure I'll have time before Christmas to get into it.
But I'll have a look if no one else jumps in before then.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

MikeR

  • Guest
Re: Keyed Note Program?
« Reply #5 on: December 19, 2005, 02:30:38 PM »
Cab,
Thanks for looking at it. I hope you have a Merry Christmas