Author Topic: creating a dcl file?  (Read 19069 times)

0 Members and 1 Guest are viewing this topic.

ELOQUINTET

  • Guest
creating a dcl file?
« on: November 06, 2003, 10:55:20 AM »
hey guys i'm wondering how to create a dcl file and if what i want is possible. i have a bunch of lisps i would like to combine into a dcl. they add suffixs after dimension text for instance:

(defun C:DLO()
     (setq ent (vlax-ename->vla-object (car (entsel "select dim"))))
     ;(vla-put-TextOverride ent "{\\Farial.shx;<> D.L.O.}")
     (vla-put-TextOverride ent "{<>\ D.L.O.}")
     (vlax-release-object ent)
)

i would like a dcl that would have various suffixs. is this possible and am i on the right track or no? thanks

dan

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
creating a dcl file?
« Reply #1 on: November 06, 2003, 11:22:34 AM »
Quote
is this possible and am i on the right track

Yes and yes. And BTW, great idea. :D
If I get some time today I'll help you get started.
TheSwamp.org  (serving the CAD community since 2003)

ELOQUINTET

  • Guest
creating a dcl file?
« Reply #2 on: November 06, 2003, 11:30:26 AM »
thanks just trying to get people to use lisp but when people see all the code they panic so i'm trying to get them to use lisp without knowing their doing so  :wink: thanks mark

dan

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
creating a dcl file?
« Reply #3 on: November 06, 2003, 02:31:16 PM »
Ok, I have uploaded an example to the lilly pond http://www.theswamp.org/lilly.pond/public/suffixlist.zip give it a try. Remember that at least the .dcl file has to be in your ACAD path.

here's the code
Code: [Select]
(defun c:dimsuffix (/ dcl_id lst ent obj suff)

  ; list of dim suffix's
  (setq lst (list " one " " two " " three "))

  ; get user input
  (if (setq ent (entsel "select dim"))
    (setq obj (vlax-ename->vla-object (car ent)))
    )

  (if
    (and obj (vlax-property-available-p obj 'TextSuffix T))
    (progn
      ; dialog stuff
      (setq dcl_id (load_dialog "suffixlist.dcl"))

      (if (not (new_dialog "sufflist" dcl_id))
        (exit) ;if dialog not found..exit
        ) ;end if

      (start_list "Slist")
      (mapcar 'add_list lst)
      (end_list)

      (action_tile
        "accept"
        "(progn
        (setq suff (get_tile \"Slist\"))
        (done_dialog)
        )"  
      )

    (action_tile
      "cancel" "(done_dialog)
      (exit)"
      )

      (start_dialog)
      (unload_dialog dcl_id)
      ); progn
    ; else
    (alert "Selected object does appear to be a dimension")
    ) ;if

  (if suff
    (progn
      (vlax-put-property obj 'TextSuffix (nth (atoi suff) lst))
      (vlax-release-object obj)
      )
    ); if
  (princ)
  ) ; defun

DCL code
Code: [Select]

sufflist  : dialog {
           label = "Dim Suffix List";
          : boxed_column {
           label = "Select Dim Suffix";
          : list_box {
           key = "Slist";
           allow_accept=true;
          }
         }
        ok_cancel;
       }
TheSwamp.org  (serving the CAD community since 2003)

ELOQUINTET

  • Guest
creating a dcl file?
« Reply #4 on: November 06, 2003, 02:49:39 PM »
thanks mark for all your efforts. pardon my ignorance but do i need to add my various code in and if so where do i put it. secondly, i create the top as a lisp and the bottom as a dcl. as you can tell i've never created dcl before. where do i do this. the lisp part i got vlide but dcl not sure. gracias

dan

ELOQUINTET

  • Guest
creating a dcl file?
« Reply #5 on: November 06, 2003, 02:52:22 PM »
ah i see you can create dcl in vlide but the other question is still on the table

dan

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
creating a dcl file?
« Reply #6 on: November 06, 2003, 03:03:16 PM »
Ok, from the top.
1) make a new folder, say c:\lisp-dan
2) add that folder to the ACAD "Support file search path"
3) unzip file from lilly pond in new folder (c:\lisp-dan)
4) load lisp file into ACAD (load "dimsuffix")
5) in ACAD type dimsuffix and follow prompts

the dimsuffix program will load the .dcl file so long as it's in the ACAD search path.

You can add your code to the lisp but, it has to be in the right place. I tried to give you something to work with and learn from, if it gets the best of ya just yell. :D
TheSwamp.org  (serving the CAD community since 2003)

daron

  • Guest
creating a dcl file?
« Reply #7 on: November 06, 2003, 03:15:04 PM »
Just to mode sure you understand: The dcl file has to be in its own file. You cannot put it in the same file as a lisp.

ELOQUINTET

  • Guest
creating a dcl file?
« Reply #8 on: November 06, 2003, 03:19:58 PM »
ah i gotcha it's up and running. i had cut and pasted the code from the forum created both and was putting my suffixes in place of "1" "2" "3".
gosh it's scary i'm beginning to kinda understan this mumbo jumbo. uhhum kinda. question though i have quite a few suffixes so as i'm adding to the list what if any type of structure do i have to keep i.e. the one i was editing looked like this but it didn't return just kept going. just trying to learn the proper way. thanks a bunch man

dan

  ; list of dim suffix's
  (setq lst (list " D.L.O. " " V.I.F. " " O.A. " " O.D. " " I.D. " " PANEL " " DOOR "))

ELOQUINTET

  • Guest
creating a dcl file?
« Reply #9 on: November 06, 2003, 03:25:03 PM »
by the way mark i had created an addons folder in my acad support folder but you say it's best to keep it seperate? i'll take your advice thanks

dan

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
creating a dcl file?
« Reply #10 on: November 06, 2003, 03:37:09 PM »
Quote from: eloquintet
question though i have quite a few suffixes so as i'm adding to the list what if any type of structure do i have to keep i.e. the one i was editing looked like this but it didn't return just kept going.

  ; list of dim suffix's
  (setq lst (list " D.L.O. " " V.I.F. " " O.A. " " O.D. " " I.D. " " PANEL " " DOOR "))

The one you show here looks fine, if I understand correctly that is. :D

I would like to make the program read a list of suffix/prefix from a file, and also have a user interface for adding to the list. Hows that sound?
TheSwamp.org  (serving the CAD community since 2003)

ELOQUINTET

  • Guest
creating a dcl file?
« Reply #11 on: November 06, 2003, 04:01:47 PM »
ummm yeah sure as long as it works. one thing i would like also is a bigger dialogue box so you don't have to scroll down. also is there a way to make it so you can select multiple dims or maybe if it remebered the previous suffix you added. these would all be nice. cheers

dan

daron

  • Guest
creating a dcl file?
« Reply #12 on: November 06, 2003, 04:24:32 PM »
Why don't you give it a try. Think of the keyword; width.

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
creating a dcl file?
« Reply #13 on: November 07, 2003, 11:25:23 AM »
A new and improved version. See .txt file in the link below.

http://www.theswamp.org/lilly.pond/public/DimPrefixSuffix.zip
TheSwamp.org  (serving the CAD community since 2003)

ELOQUINTET

  • Guest
creating a dcl file?
« Reply #14 on: November 17, 2003, 10:27:51 AM »
hey mark back to my dim suffix dcl. i am using it now and don't recall this happening before. in our dimstyle we use fractional and add an " suffix. well when i add my suffix it wipes out the inch. how do i get it to just add to the existing suffix? this is also a problem in that if for some reason i want to change the suffix or omit it i have to do so in properties vs in text edit.

dan