Author Topic: Edit Hatch Base  (Read 2084 times)

0 Members and 1 Guest are viewing this topic.

GDF

  • Water Moccasin
  • Posts: 2084
Edit Hatch Base
« on: February 01, 2006, 08:54:43 AM »
This code worked for me up till 2006...now it will not edit the hatch base within the routine below.

Code: [Select]
(defun HATCHBASEIT  (/ obj pt1 xcord ycord sp1) 
  (setq OBJ (entsel "\n* Select Hatch Pattern to Edit *"))
  (setq PT1 (getpoint "\n* Select New Starting Point of Hatch Pattern *"))
  (setq XCORD (car PT1))
  (setq YCORD (cadr PT1))
  (setq SP1 (list XCORD YCORD))
  (setvar "snapbase" SP1)
  (command "-hatchedit" OBJ "p" "" "" "")
  (command "snapbase" "0,0")
  (princ)
 )
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Edit Hatch Base
« Reply #1 on: February 01, 2006, 09:05:39 AM »
Gary,
I don't have the answer but do have this code.
I did not record the where & who of the code.
; Edit Hatch Base Point
Code: [Select]
(defun c:ehbp (/ hatchobject newbasex newbasey)
  (setq hatchobject (entget (car (entsel)))) ; pick hatch
  (setq newbasepoint (getpoint "\nSelect new basepoint: ")); new basepoint
  (setq newbasex (car newbasepoint)) ; x coord
  (setq newbasey (car (cdr newbasepoint))) ; y coord
  (setq hatchobject
(subst (cons 43 newbasex) ; Changes the 43 code
(assoc 43 hatchobject) ; to new x coord
hatchobject ; for basepoint
)
  )
  (setq hatchobject
(subst (cons 44 newbasey) ; Changes the 44 code
(assoc 44 hatchobject) ; to new y coord
hatchobject ; for basepoint
)
  )
  (entmod hatchobject) ; Modifies entity properties
    (princ)
)
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.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Edit Hatch Base
« Reply #2 on: February 01, 2006, 09:09:58 AM »
OK, I traced it back to here
http://cadvault.com/forums/showthread.php?p=108568
which is not a valid link, so I could not find the author.
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.

GDF

  • Water Moccasin
  • Posts: 2084
Re: Edit Hatch Base
« Reply #3 on: February 01, 2006, 09:28:28 AM »
Thanks Allen, that works perfectly in 2006.
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

mohobrien

  • Guest
Re: Edit Hatch Base
« Reply #4 on: February 01, 2006, 02:11:31 PM »
You have no idea how happy you've made me. That's the first time that something of mine has been useful! :kewl: :love:

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Edit Hatch Base
« Reply #5 on: February 01, 2006, 02:32:58 PM »
Well great. and thanks :-)
Give me a header to add to it for future.
Good work!
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.

GDF

  • Water Moccasin
  • Posts: 2084
Re: Edit Hatch Base
« Reply #6 on: February 01, 2006, 02:39:33 PM »
Yes thanks.

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