Author Topic: type libraries  (Read 13522 times)

0 Members and 1 Guest are viewing this topic.

daron

  • Guest
type libraries
« 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?

JohnK

  • Administrator
  • Seagull
  • Posts: 10603
type libraries
« Reply #1 on: September 23, 2003, 07:39:51 PM »
In the VLIDE? I seriously doubt it. In any other text editor, yes.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

daron

  • Guest
type libraries
« Reply #2 on: September 24, 2003, 11:37:40 AM »
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.

JohnK

  • Administrator
  • Seagull
  • Posts: 10603
type libraries
« Reply #3 on: September 24, 2003, 12:30:07 PM »
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.)
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Kerry B

  • Guest
type libraries
« Reply #4 on: September 25, 2003, 06:31:42 PM »
for Sybbol protection & colouring in the VL IDE you could use something like this :-

Code: [Select]

;;;-----------------------------------------------------------------------------------
;;;-----------------------------------------------------------------------------------
(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)



daron

  • Guest
type libraries
« Reply #5 on: September 25, 2003, 06:56:46 PM »
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?

JohnK

  • Administrator
  • Seagull
  • Posts: 10603
type libraries
« Reply #6 on: September 26, 2003, 08:29:51 AM »
Joe? Is that you?
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

smadsen

  • Guest
type libraries
« Reply #7 on: September 26, 2003, 03:24:12 PM »
Think Kerry meant adding defuns like this:
Code: [Select]
(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)

daron

  • Guest
type libraries
« Reply #8 on: September 26, 2003, 04:35:44 PM »
Thanks, Stig. I think I understand now.

JohnK

  • Administrator
  • Seagull
  • Posts: 10603
type libraries
« Reply #9 on: September 26, 2003, 05:12:44 PM »
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?
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

daron

  • Guest
type libraries
« Reply #10 on: September 26, 2003, 05:25:39 PM »
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?

JohnK

  • Administrator
  • Seagull
  • Posts: 10603
type libraries
« Reply #11 on: September 26, 2003, 05:32:50 PM »
I didnt try it yet cause i dont know what to do with it.  lol
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Anonymous

  • Guest
type libraries
« Reply #12 on: October 20, 2003, 06:32:44 AM »
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.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
type libraries
« Reply #13 on: October 20, 2003, 06:34:44 AM »
Who was that masked man ??

Regards
Kerrry




Note to self. login, login, login
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

daron

  • Guest
type libraries
« Reply #14 on: November 11, 2003, 11:43:05 AM »
Just in case anybody's wondering about this. I just tried it, finally, and Stig's reply is correct. Thanks, guys.

daron

  • Guest
type libraries
« Reply #15 on: November 11, 2003, 12:15:18 PM »
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?

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
type libraries
« Reply #16 on: November 11, 2003, 02:30:41 PM »
No : ...
Only from the VLisp IDE < for ALL symbols
Tools -> Window Attributes -> Configure Current
then Select LEX-SYM from the combo & set the color
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

daron

  • Guest
type libraries
« Reply #17 on: November 11, 2003, 02:35:54 PM »
Yeah, I knew about that. Thanks, though.