TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: TimSpangler on June 07, 2006, 01:45:03 PM
-
Hey Guys/ gals,
Been awhile since I've been around (new job's got me working - The nerve of some people)
Anayway triing to fix some problems around here. I wrote a hatch program to do some standard hatching, now I need to add a check for a hatch pattern. The prgram is passed the pattern name, scale, rotation, and layer. I want thecheck to make sure the pattern exsist before I try to hatch with it. Currently running some test and I found if I through it a bogus hatch it crashes.
Would like a lisp example, but ActiveX will be fine also (I don't get that stuff yet)
Thanks all.
TIM
-
Maybe something like this?
(setq name "TEST") ;; test an invalid one it will return an error.
(setq name "ANSI31") ;; test a valid one it will return T
(vl-load-com)
(not (vl-catch-all-error-p
(setq return
(vl-catch-all-apply
'vla-setvariable
(list
thisdwg "HPNAME" name)))))
-
Hey Guys/ gals,
Been awhile since I've been around (new job's got me working - The nerve of some people)
Anayway triing to fix some problems around here. I wrote a hatch program to do some standard hatching, now I need to add a check for a hatch pattern. The prgram is passed the pattern name, scale, rotation, and layer. I want thecheck to make sure the pattern exsist before I try to hatch with it. Currently running some test and I found if I through it a bogus hatch it crashes.
Would like a lisp example, but ActiveX will be fine also (I don't get that stuff yet)
Thanks all.
TIM
Tim
Lokk at http://www.turvill.com/t2/free_stuff/index.htm
GETPAT.lsp
Gary
-
Luis,
I can't get your solution to work. they both return nil for me.
Gary,
What I am triing to do is check to see if a pattern is availible before I hatch. Your solution gets patterns from a drawing.
I'll keep on triing. There has got to be a way to see if a hatch is availible.
Thanks Guys
-
Did you include this?
(setq thisdwg (vla-get-activedocument (vlax-get-acad-object)))
It is required.
-
Did you include this?
(setq thisdwg (vla-get-activedocument (vlax-get-acad-object)))
It is required.
Sorry I forgot, It has been a long day..... Thank you!
-
DOH!
So did I
Thanks CAB works like a charm.
Thanks LE.