Author Topic: Text insert routine  (Read 3798 times)

0 Members and 1 Guest are viewing this topic.

ELOQUINTET

  • Guest
Text insert routine
« on: July 26, 2006, 03:34:12 PM »
CAB,

I am interested in modifying your text insert routine so that by default it uses a specified dimension style not the current and i would like the leader type to be set to 3 point by default. I am looking through the code and need a hint what I would need to modify to aceive this. Can you or anybody else for that matter help me out. Thanks

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Text insert routine
« Reply #1 on: July 26, 2006, 04:00:35 PM »
 3 point by default, find this line
Code: [Select]
(setq useleader     0)   ; use a leader with text 0=nochange 0 to 3

Preset DimStyle, find this
Code: [Select]
  (setq cur_dim     (getvar "dimstyle")
        cur_dim_old cur_dim
  ) ; save curent Dim Style
 
 Change to this
Code: [Select]
  (setq cur_dim_old     (getvar "dimstyle")
          cur_dim <your dim style>
  ) ; save curent Dim Style


Let me know if that doesn't work, cause I didn't test it.
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.

ELOQUINTET

  • Guest
Re: Text insert routine
« Reply #2 on: July 26, 2006, 05:55:30 PM »
i'll try it tomorrow cab and let you know thanks

ELOQUINTET

  • Guest
Re: Text insert routine
« Reply #3 on: July 27, 2006, 09:08:57 AM »
hey cab i found the lines and modified them as suggested but it's not behaving how i want. i see that it switches to 3 point leader when executed no matter what i have specified. this is ok for me as i don't really use the others but for someone who may want to do a 2 point they may just abandon the routine all together. like i say it's a quick fix for me yes but limits the funtionality of the routine. now for the dimstyle part. i'm not sure if i've got the syntax right because it's not working:

Code: [Select]
  (setq cur_dim     (getvar "dimstyle")
        cur_dim_old SECT$7


do i need to put the style in quotes or do i need to do something else. also another thing i was thinking is that we put almost everything on 0 layer and have different colors. the text we have yellow but the routine sets the color to bylayer. is there a way i can make the text be yellow? thanks for everything,


CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Text insert routine
« Reply #4 on: July 27, 2006, 09:41:59 AM »
You weren't paying attention  8-)
Code: [Select]
  (setq cur_dim_old     (getvar "dimstyle")
          cur_dim SECT$7
  ) ; save curent Dim Style

Yes, this was just for you but I'll look at the 3 pt leader thing later.

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.

ELOQUINTET

  • Guest
Re: Text insert routine
« Reply #5 on: July 27, 2006, 09:58:15 AM »
hmmm i tried that and now i get this reply. i was thinking maybe i had one too many of the save dimstyle lines but if i take one out it gives me the second reply. what have i done  :ugly: below is the entire part as well


***---  Loading Text Insert, type TextInsert to run  ---***; error: extra right
paren on input

***---  Loading Text Insert, type TextInsert to run  ---***; error: no function
definition: LOAD_LIST


Code: [Select]
  ;;  SAVE SYSTEM VARIABLES
  (setq useror (getvar "orthomode"))
  (setq usercmd (getvar "CMDECHO"))
  (setvar "CMDECHO" 0)
  (setq useros (getvar "osmode"))
  (setvar "osmode" 0)
  (setq cur_lay     (getvar "clayer")
        cur_lay_old cur_lay
  ) ; save curent layer to restor on exit  *-* debug *-*
  (setq cur_txt     (getvar "TextStyle")
        cur_txt_old cur_txt
  ) ; save curent Text Style
  (setq cur_dim_old     (getvar "dimstyle")
          cur_dim SECT$7
  ) ; save curent Dim Style
  ) ; save curent Dim Style
  ) ; save curent Dim Style
  ;;  *-*  debug *-*
  (if (= (setq txt_ht (getvar "textsize"))0)
    (setvar "textsize" 0.09); ???????????
  )

ELOQUINTET

  • Guest
Re: Text insert routine
« Reply #6 on: July 27, 2006, 10:03:39 AM »
sweet i got it cab i went back and reviewed the original which only has one dimstyle line it's working now. now did you think about how i could set the text color to yellow rather than bylayer? thanks man i appreciate it

ELOQUINTET

  • Guest
Re: Text insert routine
« Reply #7 on: July 28, 2006, 11:40:37 AM »
i hate to say it cab but i tried the routine today and it's not working. the 3 point leader part is working but i'm have problems with the dimstyle part. here is the part we changed yesterday and it was working but i don't know what happened. i was thinking maybe it had to do with the fact that i am in a new drawing and the style did not exist. i tried in a file which did have it and it still does not switch to it  :-(

Code: [Select]
  (setq cur_dim_old     (getvar "dimstyle")
          cur_dim SECT$7
  ) ; save curent Dim Style
  ;;  *-*  debug *-*

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Text insert routine
« Reply #8 on: July 28, 2006, 04:02:02 PM »
Dan,
Try this version.

Revise line 153 to your text style.
Code: [Select]
      (setq Style_oride "A4")  ; override text style

<edit: Code removed, See "Show Your Stuff" forum >
« Last Edit: January 16, 2007, 11:04:20 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.

ELOQUINTET

  • Guest
Re: Text insert routine
« Reply #9 on: July 28, 2006, 04:12:36 PM »
cab when i try to download the zip it tells me i don't have access to this area?

ELOQUINTET

  • Guest
Re: Text insert routine
« Reply #10 on: July 28, 2006, 04:31:00 PM »
ah i see you've been adding some more functionality to this mine was a pretty old version. everything seems to be working now but the only problem i still have is the color is still bylayer. i realize i am in the minority so it probably won't be incorporated. i just remembered that i have it formatted to be put on a dims layer and that layers color is yellow but this is putting it on the current layer which is 0. i see you are trying to incorporate the adding and saving of notes from the dialog which is sweeeeeet can't wait to be able to do that although i'm not sure i'd want everyone creating notes and cluttering up the dialog. i am brainstorming reorganizing mine soon because i have too many categories now. thanks for the continued work you are putting into this it's a wonderful routine.

ELOQUINTET

  • Guest
Re: Text insert routine
« Reply #11 on: July 28, 2006, 04:47:21 PM »
nevermind about the layer problem cab for some reason i just had :- instead of :-L duuuuuuh carry on

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Text insert routine
« Reply #12 on: July 28, 2006, 06:58:28 PM »
i'm not sure i'd want everyone creating notes and cluttering up the dialog.

How about a "User Permission" to Add or Edit the notes? :)


And You're welcome.
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.

ELOQUINTET

  • Guest
Re: Text insert routine
« Reply #13 on: July 31, 2006, 11:41:22 AM »
cab,

if you mean permission as in write permissions to the folder containing the tid files. i have a hard enough time getting my basic autocad permissions straight. our it department is retarded. i have another question which applies to your routine though. i am setting up my tid files in the following manner but am wondering how i could update the prefix note number if i need to insert additional notes in the list. it would ask for the last number and i'd put in 05. then i could set the increment i'll say 2 then all the numbers would get bumped up by 2. how could i do that so i could run it in notepad?

***Text Item *****************************************************
01.----------------- MANUAL SHADE TUBE NOTES ---------------------
***Text Item *****************************************************
:-W6
:-LNOTES
02.  1-1/2" DIA. TUBE AND SHADE ASSEMBLY
1-1/2" %%C TUBE AND
SHADE ASSEMBLY
***Text Item *****************************************************