Author Topic: RE: Opening a drawing from a button in LISP  (Read 2291 times)

0 Members and 1 Guest are viewing this topic.

jshel101

  • Guest
RE: Opening a drawing from a button in LISP
« on: December 05, 2006, 02:38:08 PM »
Hello, I just wanted to comment on what a great site this is.

I am creating a program that i am having a problem with. Part of the routine is to have the user press a button, from a LISP dialog box, and a drawing opens up. the user will modify the attributes in the drawing, then save and close it.

What I am having problems with is that I want my dialog box to open back up so the user can perform other functions. I have talked to a few people about this and they suggested I should call my dialog box again, or to create a reacotr on how to do this. But i am not sure what the best way to do this. I am fairly new to LISP programming, so i am not sure where to go from here.

If anyone has any suggestions, that would be great.

Thanks,

Maverick®

  • Seagull
  • Posts: 14778
Re: RE: Opening a drawing from a button in LISP
« Reply #1 on: December 05, 2006, 02:51:05 PM »
 Hi jshel101!  Welcome to the Swamp.

*whispers* It might be helpful if you could post some of what you have started.  :wink:

T.Willey

  • Needs a day job
  • Posts: 5251
Re: RE: Opening a drawing from a button in LISP
« Reply #2 on: December 05, 2006, 03:02:59 PM »
First off, Welcome to the swamp.

I don't think you can do what you want with lisp the way you want to do it.  Lisp will only run in the drawing that calls it, so you can't run the lisp to open a new drawing, and then change items with the lisp in the drawing just opened, and then have the dialog stay open for more input.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

jshel101

  • Guest
Re: RE: Opening a drawing from a button in LISP
« Reply #3 on: December 05, 2006, 03:08:14 PM »
Hi jshel101!  Welcome to the Swamp.

*whispers* It might be helpful if you could post some of what you have started.  :wink:

Sorry, here is what i have so far for the button.

Code: [Select]
(action_tile "revblock" "(c:revupdate)")

(defun c:revupdate ()
  (setq full-fname "C:\\Documents and Settings\\All Users\\Application Data\\Bentley\\Plant 2004\\iso\\revblock.dwg")
  (setq full-fname (strcat "\"" full-fname "\""))
  (command "vbastmt" (strcat "AcadApplication.Documents.Open " full-fname))
);End defun

DCL Code for that button
Code: [Select]
: button {
      key = "revblock";
      label = "SET REVBLOCK";
      mnemonic = "S";
      is_default = true;
      fixed_width = true;
      alignment = centered;
  }

When I run this, my AutoCAD locks up. Not sure what else i can do.

thanks,

<edit> fixed the code tags for ya. Mav.
« Last Edit: December 05, 2006, 03:25:43 PM by Maverick® »

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: RE: Opening a drawing from a button in LISP
« Reply #4 on: December 05, 2006, 03:21:51 PM »
Why not write the code in VBA (along with the dialogs) I promise you it will be a whole lot easier, even if you don't know VBA ...

The main problem is that lisp is drawing specific, meaning that it cannot operate from one drawing to another without some activex calls, and if you are not familiar with vba, it becomes more difficult to know what to do.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

jshel101

  • Guest
Re: RE: Opening a drawing from a button in LISP
« Reply #5 on: December 05, 2006, 04:55:49 PM »
Why not write the code in VBA (along with the dialogs) I promise you it will be a whole lot easier, even if you don't know VBA ...

The main problem is that lisp is drawing specific, meaning that it cannot operate from one drawing to another without some activex calls, and if you are not familiar with vba, it becomes more difficult to know what to do.

Thanks, I will see if i can do this with VBA. I haven't programmed in VBA for quite a while, so it should be fun.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: RE: Opening a drawing from a button in LISP
« Reply #6 on: December 05, 2006, 08:21:17 PM »
Just remember, we are here to help you with your venture ... perhaps not to do it ... but to offer as much guidance as possible ... we like to call it the fisherman ideology. For a little overview of the concept see this thread
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie