Author Topic: Display DCL preview without Vlisp.  (Read 8030 times)

0 Members and 1 Guest are viewing this topic.

curmudgeon

  • Newt
  • Posts: 194
Display DCL preview without Vlisp.
« on: June 15, 2011, 05:09:23 PM »
wanting to write a dialog box - using alternate editor, but missing the preview I had in Vlisp.
no more.

Code: [Select]
((lambda(/ id)(setq id(LOAD_DIALOG "C:/Program Files/ACAD2000/$vld$.dcl"))(cond((>= id 0)(if(NEW_DIALOG "rak" id "(done_dialog)")(START_DIALOG))(UNLOAD_DIALOG id)))))
OK, I cheated. Invoked the command and copied from the Autocad Text Window (F2). I can see that there will need to be some tweaking when I want to run this in lisp, since the file won't always be "rak", and [I think] the id increments, so it won't always be 0. I could be wrong about that second part. but I am learning.

notwithstanding, I am going to feel clever for the next 17 seconds, or until I hit the post button. whichever comes first.
Never express yourself more clearly than you are able to think.

Lee Mac

  • Seagull
  • Posts: 12910
  • London, England
Re: Display DCL preview without Vlisp.
« Reply #1 on: June 15, 2011, 05:36:40 PM »
Maybe I'm missing the point, but you could just use the same construct and feed it the arguments relevant to your DCL file:

Code: [Select]
(defun DCLPreview ( file dlg / id )
  (cond
    ( (< 0 (setq id (load_dialog file)))
      (if (new_dialog dlg id "(done_dialog)") (start_dialog))
      (unload_dialog id)
    )
  )
)

curmudgeon

  • Newt
  • Posts: 194
Re: Display DCL preview without Vlisp.
« Reply #2 on: June 15, 2011, 09:17:04 PM »
It's more like I was not very clear in the first post.

I had not yet attempted to write what you did. Dialog boxes are what I am trying to get my head around just now.
Thank you for the code - I will put the time you saved me too use writing and rewriting until I get some stuff I can use.
Never express yourself more clearly than you are able to think.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Display DCL preview without Vlisp.
« Reply #3 on: June 15, 2011, 09:57:43 PM »
Why would you not use the built in editor in ACAD, VLIDE?
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.

TimSpangler

  • Water Moccasin
  • Posts: 2010
  • CAD Naked!!
Re: Display DCL preview without Vlisp.
« Reply #4 on: June 16, 2011, 09:01:16 AM »
LispLink has dialog preview.  I used it for a few years.  It worked really good (not free though)  I now use something like what Lee posted. (and I've switched to Notepad++)
ACA 2015 - Windows 7 Pro
All Comments and Content by TimSpangler, Copyright 2016

curmudgeon

  • Newt
  • Posts: 194
Re: Display DCL preview without Vlisp.
« Reply #5 on: June 16, 2011, 09:04:58 AM »
Quote
Why would you not use the built in editor in ACAD, VLIDE?

good morning - sorry, that was a part of a diiferent thread. after I kind of mangled the original thoughts, I began again here.

I have left Windows and I am running Ubuntu, Maverick Meerkat. I love the OS, but there are things I have to do to make dear old Autocad run. I don't know you will share this experience, but the interface between Vlisp and Autocad - well, I am going to call it glitchy. BUT I SURE USED IT. I love the preview for DCL, but in the new setup, the preview forces me back to Autocad, and it fails to ever quite get there. Kind of like a lock up, but somehow I have almost always been able to get Vlisp shut down and start over.

I AM JUST ALMOST THERE WITH MY FIRST USEFUL DIALOG BOX, and I am trying to find better efficiency writing it. Testing the DCL from the command line is one possible workaround.

The routine draws window in elevation, and although I have set defaults to minimze editing, there are still lots of data to input every time. A dialog box will of course let me ignore the options that do not need correction.

How is the weather in sunny FL?
( or do I have my wires crossed about longitude and latitude )
Never express yourself more clearly than you are able to think.

curmudgeon

  • Newt
  • Posts: 194
Re: Display DCL preview without Vlisp.
« Reply #6 on: June 16, 2011, 09:11:51 AM »
Quote
(and I've switched to Notepad++)

I think Notepad++ will be my baseline to compare to. But I expect to edit there, and test in Autocad, hence the terse lisp routine.
(thanks again Lee)

NOW I HAVE TO TRAIN THE DRAUGHTSMAN.
and I wonder if I have enough beer if he happens to get it right.
no, when he happens to get it right.

Se7en says "Vim", and that will be one thing I work with to make that comparision.
Never express yourself more clearly than you are able to think.

Lee Mac

  • Seagull
  • Posts: 12910
  • London, England
Re: Display DCL preview without Vlisp.
« Reply #7 on: June 16, 2011, 09:19:43 AM »
You're welcome  :-)

I suppose you could take the code a little further to emulate the VLIDE DCL Preview and have a program to read the DCL file and extract the names of any Dialog Definitions contained therein, then prompt the user to select a definition to preview from a list_box.

The only 'annoying' part would be that you would have to save the DCL file before previewing it - unless you can figure out a way to read the DCL code directly from your editor and create a temporary file like the VLIDE does.

Lee

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Display DCL preview without Vlisp.
« Reply #8 on: June 16, 2011, 09:28:30 AM »
How is the weather in sunny FL?
( or do I have my wires crossed about longitude and latitude )

Hot  Hot  Hot   :evil:

Feels like temp yesterday was 106
But we got an inch of rain last night & it cooled things off  a bit.


Thanks for the explanation.

If you were ambitious you could write a lisp to read the DCL file & generate a lisp to call it for test purposes.  8-)  <edit: I guess Lee just said that, as I go for my second cup. Dooough >

« Last Edit: June 16, 2011, 10:29:21 AM by CAB »
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.

curmudgeon

  • Newt
  • Posts: 194
Re: Display DCL preview without Vlisp.
« Reply #9 on: June 16, 2011, 11:18:38 AM »
Quote
The only 'annoying' part would be that

MANIACLE LAUGHTER ENSUES.

I am breaking trail here. I know, to work under the new OS. Latest annoying part is that the MTEXT editor background is black, like the text renders in the edit box, black. System variables, options in the editor, no joy. Finally learned how to change the default editor, and remember that C: on this machine is not what Autocad thinks it is......

But it works. And I have some plans to crank out - getting paid something for beta testing.

"the weather is here, I wish you were beautiful" is running through my mind.
77 degrees, clear sky, RH 57%, Wind south / 6.0 knots.

that's what they call "Chamber of Commerce" weather for Missouri. it doesn't get any better than that.
Never express yourself more clearly than you are able to think.

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: Display DCL preview without Vlisp.
« Reply #10 on: June 16, 2011, 02:19:55 PM »
James Buzbee
Windows 8

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Display DCL preview without Vlisp.
« Reply #11 on: June 16, 2011, 02:22:12 PM »
http://www.opendcl.com

 :wink:
:-D


How is the weather in sunny FL?
( or do I have my wires crossed about longitude and latitude )

Hot  Hot  Hot   :evil:

Feels like temp yesterday was 106
But we got an inch of rain last night & it cooled things off  a bit.


Thanks for the explanation.

If you were ambitious you could write a lisp to read the DCL file & generate a lisp to call it for test purposes.  8-)  <edit: I guess Lee just said that, as I go for my second cup. Dooough >


It's hot as hell in North Florida and with this fire in Georgia, there's smoke everywhere.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

curmudgeon

  • Newt
  • Posts: 194
Re: Display DCL preview without Vlisp.
« Reply #12 on: June 16, 2011, 02:37:56 PM »
opendcl downloaded and installed.
hello learning curve, or are you just glad to see me?
 8-)

feeling a bit like a 13 year cicada just landed in my 7 course meal with all the goodies on my plate.
but I like it.

butter please.
Never express yourself more clearly than you are able to think.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Display DCL preview without Vlisp.
« Reply #13 on: June 16, 2011, 02:41:48 PM »
sorry that's not butter
Engineering Technologist CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com http://cadanalyst.slack.com http://linkedin.com/in/cadanalyst

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Display DCL preview without Vlisp.
« Reply #14 on: June 16, 2011, 02:42:30 PM »
James, do you have some kind of notification every time DCL is typed in at theSwamp? LoL
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox