Jump to content

Hatching an object with 2 patterns


nod684

Recommended Posts

Our company has this habit of hatching an object twice using the AR-CONC and ANSI31 patterns respectively using 100 as hatch scale.

 

is it possible to have a routine than can do this automatically by picking in the internal points or just by selecting the closed object?

Link to comment
Share on other sites

Closed 0bject is the best just need to run a simple VLA-addhatch twice. Just looking for example its vla-addhatch mspace hatch-pattern obj etc trying to find where I put it.

Link to comment
Share on other sites

You could combine the two patterns, pre-scaled by 100, as a custom pattern:

 

*AR-CONC-ANSI131X100,Random dot and stone pattern plus ANSI31 scaled by 100

;-------------------------------------------------------------------------------

; Pattern written by HatchKit v2.7 Hatch Pattern Editor

; HatchKit v2.7 Hatch Pattern Editor© Cadro Pty Ltd 1990-2014.

; www.hatchkit.com.au

;-------------------------------------------------------------------------------

;-Template=AR-CONC, Random dot and stone pattern

;-Source =G:\Users\Hugh\Desktop\TestHatches\ANSI31X100.PAT

;-Date =21/02/2014

;-Time =12:57:59 AM

;-------------------------------------------------------------------------------

71.4514447388,149.74,116.45,191.82358991,693.976736169,63.74,-701.14230388

-34.0000000164,100,150,516.218792505,737.236840008,60,-659.999999993

21,100,150,487.024966,589.789472,75,-825

96.6356447388,88.937,186.21,287.735384866,1040.96510425,95.61,-1051.71345582

-8.81580001637,0,200,774.328188758,1105.85526001,90,-989.999999989

46.1842,0,200,730.537449,884.684208,112.5,-1237.5

100.451444739,59.772,-5.2293,191.82358991,693.976736169,63.74,-701.14230388

-5.00000001637,0,0,516.218792505,737.236840008,60,-659.999999993

50,0,0,487.024966,589.789472,75,-825

7.75374509883,0,0,56.9612851418,328.209676876,0,-1552.1210552

7.75374509883,517.27,396.91,56.9612851418,328.209676876,0,-1552.1210552

7.75374509883,1048.8,804.78,56.9612851418,328.209676876,0,-1552.1210552

9.74000554536,-323,0,214.228105711,1248.03846346,0,-591.715400847

9.74000554536,-83.385,-219.57,214.228105711,1248.03846346,0,-591.715400847

9.74000554536,298.52,-569.52,214.228105711,1248.03846346,0,-591.715400847

68.8819167095,645.69,-553.42,921.397900388,506.097174029,0,-1092.68936556

68.8819167095,-12.152,-134.32,921.397900388,506.097174029,0,-1092.68936556

68.8819167095,-223,0,921.397900388,506.097174029,0,-1092.68936556

56.2970215044,0,0,110.616853275,956.652017074,0,-474.095117039

56.2970215044,378.73,49.861,110.616853275,956.652017074,0,-474.095117039

56.2970215044,1010.3,133.01,110.616853275,956.652017074,0,-474.095117039

45,0,0,0,12.5

 

 

hth,

 

 

Hugh Adamson

www.hatchkit.com.au

Link to comment
Share on other sites

You could combine the two patterns, pre-scaled by 100, as a custom pattern:

 

*AR-CONC-ANSI131X100,Random dot and stone pattern plus ANSI31 scaled by 100

;-------------------------------------------------------------------------------

; Pattern written by HatchKit v2.7 Hatch Pattern Editor

; HatchKit v2.7 Hatch Pattern Editor© Cadro Pty Ltd 1990-2014.

; www.hatchkit.com.au

;-------------------------------------------------------------------------------

;-Template=AR-CONC, Random dot and stone pattern

;-Source =G:\Users\Hugh\Desktop\TestHatches\ANSI31X100.PAT

;-Date =21/02/2014

;-Time =12:57:59 AM

;-------------------------------------------------------------------------------

71.4514447388,149.74,116.45,191.82358991,693.976736169,63.74,-701.14230388

-34.0000000164,100,150,516.218792505,737.236840008,60,-659.999999993

21,100,150,487.024966,589.789472,75,-825

96.6356447388,88.937,186.21,287.735384866,1040.96510425,95.61,-1051.71345582

-8.81580001637,0,200,774.328188758,1105.85526001,90,-989.999999989

46.1842,0,200,730.537449,884.684208,112.5,-1237.5

100.451444739,59.772,-5.2293,191.82358991,693.976736169,63.74,-701.14230388

-5.00000001637,0,0,516.218792505,737.236840008,60,-659.999999993

50,0,0,487.024966,589.789472,75,-825

7.75374509883,0,0,56.9612851418,328.209676876,0,-1552.1210552

7.75374509883,517.27,396.91,56.9612851418,328.209676876,0,-1552.1210552

7.75374509883,1048.8,804.78,56.9612851418,328.209676876,0,-1552.1210552

9.74000554536,-323,0,214.228105711,1248.03846346,0,-591.715400847

9.74000554536,-83.385,-219.57,214.228105711,1248.03846346,0,-591.715400847

9.74000554536,298.52,-569.52,214.228105711,1248.03846346,0,-591.715400847

68.8819167095,645.69,-553.42,921.397900388,506.097174029,0,-1092.68936556

68.8819167095,-12.152,-134.32,921.397900388,506.097174029,0,-1092.68936556

68.8819167095,-223,0,921.397900388,506.097174029,0,-1092.68936556

56.2970215044,0,0,110.616853275,956.652017074,0,-474.095117039

56.2970215044,378.73,49.861,110.616853275,956.652017074,0,-474.095117039

56.2970215044,1010.3,133.01,110.616853275,956.652017074,0,-474.095117039

45,0,0,0,12.5

 

 

hth,

 

 

Hugh Adamson

www.hatchkit.com.au

 

wow.. i never though of that...

besides i don't know how to code the pattern anyway...

 

thanks! a lot will try this out and give feedback

Link to comment
Share on other sites

hugha the ar-conc pattern has a nasty habit of not working and requiring resetting of the origin point if working in real world co-ords so not sure aout combining two hatches.

Link to comment
Share on other sites

nod684, add an extra blank line at the end of the file and try again.

 

 

BIGAL, try it anywhere you like - HatchKit recalculates poorly specified patterns to work at high co-ordinates. We explain this at http://www.hatchkit.com.au/faq.php#Tip2

 

 

Hugh Adamson

www.hatchkit.com.au

 

now it says missing parameter at Line 33 then ? on the next line...

Link to comment
Share on other sites

Our company has this habit of hatching an object twice using the AR-CONC and ANSI31 patterns respectively using 100 as hatch scale.

 

is it possible to have a routine than can do this automatically by picking in the internal points or just by selecting the closed object?

 

In addition to what BIGAL said, and as a demo for select an object or pick a point:

(defun c:Myh ( / pt)
 (vl-load-com)

(defun isclosed (pt / msg vlaobj)
 (setq vlaobj (vlax-ename->vla-object pt)
msg "\nNot a closed Entity!!!")
 (cond ((wcmatch (vla-get-objectname vlaobj) "AcDbEllipse")
 (if (and (= (vlax-curve-getStartParam vlaobj) 0.0)
   (= (vlax-curve-getEndParam vlaobj) (* pi 2))
   );; and
   (bhatchobj pt)
   (prompt msg)
   );; if
 )
((wcmatch (vla-get-objectname vlaobj) "AcDbSpline,*Polyline")
 (if (= (vla-get-closed vlaobj) :vlax-true)
   (bhatchobj pt)
   (prompt msg)
   );; if
 )
((wcmatch (vla-get-objectname vlaobj) "AcDbCircle")
 (bhatchobj pt)
 (prompt msg)
 )
((prompt msg))
);; cond
 );; isclosed
(defun bhatchpt (pt)
 (command "-bhatch" "_P" "AR-CONC" "100" "0" pt ""
   "-bhatch" "_P" "ANSI31" "100" "0" pt "")
 );; bhatchpt
(defun bhatchobj (pt)
 (command "-bhatch" "_P" "AR-CONC" "100" "0" "_S" pt "" ""
   "-bhatch" "_P" "ANSI31" "100" "0" "_S" pt "" "")
 );; bhatchobj
;; Rebuilt by me
;; from Tony Tanzillo's SelectObjectOrWindow
(defun hms:SelP ( / ans)
(setvar "errno" 0)
(if (setq ans (entsel "\nSelect Closed Object or Pick a Point <exit>: "))
(car ans)
(if (and (eq 7 (getvar "errno"))
  (setq ans (grread t))
    );;and
  (setq ans (cadr ans))
  );; if
  );; if
 );; hms:SelP
 (while (setq pt (hms:SelP))
(cond ((and pt (= (type pt) 'ENAME))
      (isclosed pt)
      )
     (pt 
      (bhatchpt pt)
      )
     );; cond
 );; while
 (princ)
 );; myh

HTH

Henrique

Edited by hmsilva
typo in BIGAL name, sorry
Link to comment
Share on other sites

Try the attached file (remove the .txt extension first!)

 

thanks a lot! its working fine now...

however can i request to change the scale of concrete to 25 and the ansi31 to 100?

sorry i don't know where to edit that in the pattern.

 

 

 

In addition to what BIGALL said, and as a demo for select an object or pick a point:

(defun c:Myh ( / pt)
 (vl-load-com)

(defun isclosed (pt / msg vlaobj)
 (setq vlaobj (vlax-ename->vla-object pt)
msg "\nNot a closed Entity!!!")
 (cond ((wcmatch (vla-get-objectname vlaobj) "AcDbEllipse")
 (if (and (= (vlax-curve-getStartParam vlaobj) 0.0)
   (= (vlax-curve-getEndParam vlaobj) (* pi 2))
   );; and
   (bhatchobj pt)
   (prompt msg)
   );; if
 )
((wcmatch (vla-get-objectname vlaobj) "AcDbSpline,*Polyline")
 (if (= (vla-get-closed vlaobj) :vlax-true)
   (bhatchobj pt)
   (prompt msg)
   );; if
 )
((wcmatch (vla-get-objectname vlaobj) "AcDbCircle")
 (bhatchobj pt)
 (prompt msg)
 )
((prompt msg))
);; cond
 );; isclosed
(defun bhatchpt (pt)
 (command "-bhatch" "_P" "AR-CONC" "100" "0" pt ""
   "-bhatch" "_P" "ANSI31" "100" "0" pt "")
 );; bhatchpt
(defun bhatchobj (pt)
 (command "-bhatch" "_P" "AR-CONC" "100" "0" "_S" pt "" ""
   "-bhatch" "_P" "ANSI31" "100" "0" "_S" pt "" "")
 );; bhatchobj
;; Rebuilt by me
;; from Tony Tanzillo's SelectObjectOrWindow
(defun hms:SelP ( / ans)
(setvar "errno" 0)
(if (setq ans (entsel "\nSelect Closed Object or Pick a Point <exit>: "))
(car ans)
(if (and (eq 7 (getvar "errno"))
  (setq ans (grread t))
    );;and
  (setq ans (cadr ans))
  );; if
  );; if
 );; hms:SelP
 (while (setq pt (hms:SelP))
(cond ((and pt (= (type pt) 'ENAME))
      (isclosed pt)
      )
     (pt 
      (bhatchpt pt)
      )
     );; cond
 );; while
 (princ)
 );; myh

 

HTH

Henrique

 

Thanks so much Henrique...working fine! i superb!

Link to comment
Share on other sites

thanks a lot! its working fine now...

however can i request to change the scale of concrete to 25 and the ansi31 to 100?

sorry i don't know where to edit that in the pattern.

 

 

You'll see the unbroken line from ANSI131 remains scaled by 100 while the broken lines forming AR-CONC are now scaled by 25 instead of 100.

 

You can do this sort of thing in Excel, just scale every number in the pattern except the first on each line (which should remain unchanged) but I'm using something else for this. :)

 

 

hth,

Hugh Adamson

www.hatchkit.com.au

AR-CONCX25-ANSI131X100.PAT.txt

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...