Jump to content

Merge the DCL and Lisp File.


Elias

Recommended Posts

4 hours ago, Elias said:

Hello everyone,

I have DCL and lisp file want to merge it into vlx file, can someone please show me how I can make it.

Quite a few answers on the web already:

image.thumb.png.128eda7a08bccf0b621dc161a544997e.png

  • Like 1
  • Funny 1
Link to comment
Share on other sites

I know these steps and I merged the files but still, I have to save the DCL file into C:\Program Files\Autodesk\AutoCAD 2020\Support. so I can run the VLX file

Edited by Elias
Link to comment
Share on other sites

42 minutes ago, Elias said:

I know these steps and I merged the files but still, I have to save the DCL file into C:\Program Files\Autodesk\AutoCAD 2020\Support. so I can run the VLX file

Better yet learn how to write the DCL files on the fly then you don't need to include anything.

 

FWIW .. when posting questions, provide as much information as possible about what you've already tried. This will help much getting from point A to point Z. 

Link to comment
Share on other sites

Like ronjonp take your dcl and just add write-line to every line add to your lisp, then you can make the dcl on fly. Note the "fname" must be used for dcl file name

(setq fo (open (setq fname (vl-filename-mktemp "" "" ".dcl")) "w"))
  (write-line "ddgetvalAH : dialog {" fo)
  (write-line (strcat "	label =" (chr 34) (nth 0 dcllst) (chr 34) " ;") fo)
  (write-line " : column {" fo)
  (write-line " width =25;" fo)
....................
(close fo)

your code
(setq dcl_id (load_dialog fname))
..............
  (unload_dialog dcl_id)
  (vl-file-delete fname)

 

Link to comment
Share on other sites

I uploaded the file can you please edit due I didn't understand it.

 

 

 

1 hour ago, BIGAL said:

 

Like ronjonp take your dcl and just add write-line to every line add to your lisp, then you can make the dcl on fly. Note the "fname" must be used for dcl file name


(setq fo (open (setq fname (vl-filename-mktemp "" "" ".dcl")) "w"))
  (write-line "ddgetvalAH : dialog {" fo)
  (write-line (strcat "	label =" (chr 34) (nth 0 dcllst) (chr 34) " ;") fo)
  (write-line " : column {" fo)
  (write-line " width =25;" fo)
....................
(close fo)

your code
(setq dcl_id (load_dialog fname))
..............
  (unload_dialog dcl_id)
  (vl-file-delete fname)

 

Link to comment
Share on other sites

Ok you need to post the edited dcl as step1 if you want it as 1 file. That is your task !

 

include a space in these 

add  (write-line to the start of every line

add fo) to every line.

 

Then post and can then can change the lisp code to include the dcl as 1st step, then look at text added on as 2nd variation.

 

I wont go into it but it is about 2 minutes work in Word to add the two bits to every line. Hint can replace ^p

Link to comment
Share on other sites

Nice rlx and grr maybe takes me 4 replaces to do in Word and Notepad sure could do somehow in Notepad++ will have a look for ^p

 

open dcl in Word

Replace ^p " fo)^p all

Replace " \" all

Replace ^p ^p(write-line " all

Ctrl+c the "  in notepad Replace, paste the " with " all

the two " are different.

 

(write-line "dd4x3: dialog {  " fo)

(write-line "label        = \”Please choose item\”;  " fo)

(write-line  " : column {  " fo)

(write-line  "    : row {  "  fo)

 

image.png.f6a315bbc2e8ce37382c01bed01c45d2.png

 

 

Link to comment
Share on other sites

1 hour ago, BIGAL said:

open dcl in Word

Replace ^p " fo)^p all

Replace " \" all

Replace ^p ^p(write-line " all

Ctrl+c the "  in notepad Replace, paste the " with " all

the two " are different.

You don't need to open the dcl file in other than Vslide and here is a very simple example with the use of Replacement dialog and its a matter of 2 seconds.

 

Replacement.gif

Link to comment
Share on other sites

Using ^p is the end of line so can add string to end of an existing string or at the start of a line, ^t is tab another character that can be used in replace.

 

Found the Notepad++ version https://code.i-harness.com/en/q/a7e771#:~:text=the - notepad%2B%2B replace end of line with,allows you to type on every line simultaneously.

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...