Author Topic: creating a dcl file?  (Read 19242 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: 28762
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: 28762
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: 28762
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: 28762
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: 28762
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

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
creating a dcl file?
« Reply #15 on: November 17, 2003, 10:55:18 AM »
I'm working on that Dan, I'm also going to have it read the prefix/suffix list from a file. Maybe done today with a beta version.
TheSwamp.org  (serving the CAD community since 2003)

ELOQUINTET

  • Guest
creating a dcl file?
« Reply #16 on: November 17, 2003, 10:59:14 AM »
ok thanks mark got so sidetracked with that menu mess i fogot about this

dan

ELOQUINTET

  • Guest
creating a dcl file?
« Reply #17 on: November 17, 2003, 11:03:36 AM »
o yeah and remember multiple selection or remembering the last selection
(if that's not too much to ask)  :oops:

dan

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
creating a dcl file?
« Reply #18 on: November 17, 2003, 11:17:28 AM »
Quote from: eloquintet
o yeah and remember multiple selection or remembering the last selection

It does that now, does it not?
TheSwamp.org  (serving the CAD community since 2003)

ELOQUINTET

  • Guest
creating a dcl file?
« Reply #19 on: November 17, 2003, 11:39:46 AM »
no if i repeat the command and don't select another suffix it reverts to the top suffix. this may be because i am using the original maybe you did fix it in the vlx version you did later. i'm not using that one because i can't open the file to add new suffixes as they come to mind. sorry my mistake :oops: i'll keep my big mouth shut

dan

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
creating a dcl file?
« Reply #20 on: November 17, 2003, 11:47:59 AM »
Dan you are going to love the next version. :D
TheSwamp.org  (serving the CAD community since 2003)

ELOQUINTET

  • Guest
creating a dcl file?
« Reply #21 on: November 17, 2003, 11:54:43 AM »
:? zip my mouth is shut

dan

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
creating a dcl file?
« Reply #22 on: November 17, 2003, 03:12:57 PM »
TheSwamp.org  (serving the CAD community since 2003)

ELOQUINTET

  • Guest
creating a dcl file?
« Reply #23 on: November 17, 2003, 04:10:57 PM »
thanks mark works great. just wondering is there a way to rather than add this as a suffix to add it to add it so if you going into dimedit you will see a.f.f. or whatever so you could remove it that way rather than going into properties. it works alright as is for me but i'm thinking of others who might not know where to look for the suffix to remove it if need be.

dan

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
creating a dcl file?
« Reply #24 on: November 17, 2003, 04:58:06 PM »
You mean add an option to remove a suffix?
TheSwamp.org  (serving the CAD community since 2003)

ELOQUINTET

  • Guest
creating a dcl file?
« Reply #25 on: November 18, 2003, 07:58:05 AM »
yeah i'm just thinking about my boss coming to me and asking me where the v.i.f. is when he tries to omit it using the dim editor. is there a way to make the text that's added show up in the text editor instead of as a suffix. with it being a suffix someone could do match properties and another dimension would then have f.s. after it, not good. actually i did it and i know what the program does. if this is alot of work don't bother i was just thinking it might make it more idiot proof. thanks man

dan

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
creating a dcl file?
« Reply #26 on: November 18, 2003, 08:01:10 AM »
Dan, I'm still not sure what it is you are talking about, sorry! But, maybe this version will clear things up.
http://www.theswamp.org/swamp.files/mark/DimPrefixSuffix.zip
TheSwamp.org  (serving the CAD community since 2003)

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
creating a dcl file?
« Reply #27 on: November 18, 2003, 08:03:34 AM »
Oh, the light just came on! Now I see what you are refering to. :D  You want a way to edit the prefix/suffix without going to the poprerties dialog. Right?
TheSwamp.org  (serving the CAD community since 2003)

ELOQUINTET

  • Guest
creating a dcl file?
« Reply #28 on: November 18, 2003, 08:08:51 AM »
if you go into the mtext editor which is how they are accustomed to adding dim suffixes there is nothing after the carrots. i would like it to be added so it would show up here rather than as a true suffix or prefix if that's possible. this way if someone does match properties the other dimension does not inheret an improper suffix. not to metion if it already has a suffix. so it would then say 133" d.l.o. f.s. i can just see that disaster coming. sorry i've kinda lead you down the wrong path but you know how you sometimes don't think about these type things til it's done. hope this helps explain what i mean

dan

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
creating a dcl file?
« Reply #29 on: November 18, 2003, 08:25:55 AM »
We're talking text override......
This is going to change the WHOLE program!

It's time for a new thread folks, be back soon.

>i can just see that disaster coming
So it's your job Dan to educate the other users. :D
TheSwamp.org  (serving the CAD community since 2003)

SMadsen

  • Guest
creating a dcl file?
« Reply #30 on: November 18, 2003, 08:30:36 AM »
Heh

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
creating a dcl file?
« Reply #31 on: November 18, 2003, 08:46:59 AM »
Ok, so I went back to post no.1 in this thread and there it is plain as day! (vla-put-TextOverride ent so I lead myself down the wrong path, not you Dan. Oh well ...........
TheSwamp.org  (serving the CAD community since 2003)

ELOQUINTET

  • Guest
creating a dcl file?
« Reply #32 on: November 18, 2003, 09:26:47 AM »
i'm really sorry mark i kind of mislead you a little by calling it a suffix instead of a text override too  :( . you're right about the education though. i'm trying to put together tools to help others here but i'm not a cad manager and have tons of work of my own to do so i need things that are very streamline so i'm not having to go help them every 5 minutes ya know. i will educate them but i can only take baby steps unfortunately. i have created a lisp folder in our library which also has some tutorials but i only have so much time to dedicate to it. maybe we should start a new thread eh.

dan

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
creating a dcl file?
« Reply #33 on: November 18, 2003, 09:31:21 AM »
>maybe we should start a new thread eh.
Let's.
TheSwamp.org  (serving the CAD community since 2003)