TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: daron on September 23, 2003, 05:31:55 PM
-
Is it possible to take the functions we have made and put them in a type library, so when writing new routines that use these they'll turn blue, or whatever color your built in functions turn when you type them out?
-
In the VLIDE? I seriously doubt it. In any other text editor, yes.
-
Okay, so how would you create one? I'd like to try it in the vlide after one is created. I would assume it's like any other tlb. As soon as it's imported, it should work. I did the funniest thing yesterday that made me think of it. I did this (vlax-import-type-library :tlb-filename "axdb15") and it turned things like Item and Freeze and ActiveDocument, blue. I didn't need to put vla in front of them at all. Not what I expected, but it re-spawned an old idea.
-
Dude your nuts! I havent the slightest idea how to create a type lib. Well i supose you could create it in VB6 but i dont know how. (Ill see if i can find any info for ya)
...I swear, one of these days im going to help you set up VIM. (A better text editor. Youll never look back.) Everything is a text file and quick as shit. Any functions i want added, all i have to do is add those function names to a file and VIM colors them for me. (in any color i want.)
-
for Sybbol protection & colouring in the VL IDE you could use something like this :-
;;;-----------------------------------------------------------------------------------
;;;-----------------------------------------------------------------------------------
(vl-load-com)
(setq *temp-symbols* '(kpsl_savesysvar kpsl_on_error
kpsl_ptos kpsl_dtr
kpsl_rtd kpsl_deflection
kpsl_midpoint kpsl_getpoint
kpsl_getint kpsl_entsel
c:testarcdim
)
)
(eval (list 'pragma
(list 'quote (list (cons 'unprotect-assign *temp-symbols*)))
)
)
;;;-----------------------------------------------------------------------------------
;;;-----------------------------------------------------------------------------------
;; add the defuns here < snip >
;;;-----------------------------------------------------------------------------------
;;;-----------------------------------------------------------------------------------
(eval
(list 'pragma (list 'quote (list (cons 'protect-assign *temp-symbols*))))
)
(setq *temp-symbols* nil)
-
Kerry, could you help me set this up? I have no idea what pragma is and what should be in the *temp-symbols* list and the add defuns here? In what way should I add them?
(nameofdefun) or do I need to wrap each function in this whole thing or what?
-
Joe? Is that you?
-
Think Kerry meant adding defuns like this:
(vl-load-com)
(setq *temp-symbols* '(kpsl_savesysvar kpsl_on_error kpsl_ptos
kpsl_dtr kpsl_rtd kpsl_deflection
kpsl_midpoint kpsl_getpoint kpsl_getint
kpsl_entsel c:testarcdim
)
)
(eval (list 'pragma
(list 'quote (list (cons 'unprotect-assign *temp-symbols*)))
)
)
;;;-----------------------------------------------------------------------------------
;;;-----------------------------------------------------------------------------------
;; add the defuns here < snip >
(defun kpsl_dtr (a)
(* (/ a 180.0) pi)
)
(defun kpsl_midpoint (p1 p2)
(princ "OK, so this is not Kerry's midpoint function")
(princ)
)
;;; etc....
;;;-----------------------------------------------------------------------------------
;;;-----------------------------------------------------------------------------------
(eval
(list 'pragma (list 'quote (list (cons 'protect-assign *temp-symbols*))))
)
(setq *temp-symbols* nil)
-
Thanks, Stig. I think I understand now.
-
Man you guys got me confused. Where do you add that to. As a file in your suport file search path? In the acad doc lisp?
-
I see it as being wrapped around your functions. I haven't had a chance to try it, yet, so I don't know if it is what I am looking for, but I think it is. What'd you get?
-
I didnt try it yet cause i dont know what to do with it. lol
-
Hi John,
I had forgotten about this guest post, time flies ..
Did you get this sorted .. ??
If you like I can do a short tutor on how to make this work ..
it wont be this week though, as I have a course to attend and my spare time will be zip, nada, zilch.
-
Who was that masked man ??
Regards
Kerrry
Note to self. login, login, login
-
Just in case anybody's wondering about this. I just tried it, finally, and Stig's reply is correct. Thanks, guys.
-
Kerry, now that I've got this working, do you or anybody else know of a way to change the color of user defined functions?
-
No : ...
Only from the VLisp IDE < for ALL symbols
Tools -> Window Attributes -> Configure Current
then Select LEX-SYM from the combo & set the color
-
Yeah, I knew about that. Thanks, though.