Author Topic: How to check for a hatch pattern?  (Read 2826 times)

0 Members and 1 Guest are viewing this topic.

TimSpangler

  • Water Moccasin
  • Posts: 2010
  • CAD Naked!!
How to check for a hatch pattern?
« 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
ACA 2015 - Windows 7 Pro
All Comments and Content by TimSpangler, Copyright © 2016

LE

  • Guest
Re: How to check for a hatch pattern?
« Reply #1 on: June 07, 2006, 02:30:02 PM »
Maybe something like this?
Code: [Select]
(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)))))

GDF

  • Water Moccasin
  • Posts: 2081
Re: How to check for a hatch pattern?
« Reply #2 on: June 07, 2006, 02:34:51 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



Tim

Lokk at http://www.turvill.com/t2/free_stuff/index.htm
GETPAT.lsp

Gary
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

TimSpangler

  • Water Moccasin
  • Posts: 2010
  • CAD Naked!!
Re: How to check for a hatch pattern?
« Reply #3 on: June 07, 2006, 03:44:31 PM »
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
ACA 2015 - Windows 7 Pro
All Comments and Content by TimSpangler, Copyright © 2016

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: How to check for a hatch pattern?
« Reply #4 on: June 07, 2006, 03:51:54 PM »
Did you include this?
(setq thisdwg (vla-get-activedocument (vlax-get-acad-object)))
It is required.
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.

LE

  • Guest
Re: How to check for a hatch pattern?
« Reply #5 on: June 07, 2006, 03:53:30 PM »
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!

TimSpangler

  • Water Moccasin
  • Posts: 2010
  • CAD Naked!!
Re: How to check for a hatch pattern?
« Reply #6 on: June 07, 2006, 03:55:54 PM »
DOH!

So did I

Thanks CAB works like a charm.

Thanks LE.
ACA 2015 - Windows 7 Pro
All Comments and Content by TimSpangler, Copyright © 2016