REVCLOUD HATCHING LISP

REVCLOUD HATCHING LISP

spartan_vng
Enthusiast Enthusiast
1,581 Views
5 Replies
Message 1 of 6

REVCLOUD HATCHING LISP

spartan_vng
Enthusiast
Enthusiast

Hi all,

Need some help trying to trouble shoot this routine.

As a non literate lisp person I managed to put together this lisp routing that is suppose to create specific layers and draw a rev cloud and tri and hatch it on a specified layer based on the users input selection.

The original code was from 2 different sources..one handled the rev cloud and the other handle the selection of hatching.

It was working last week but now when I run the routine the pop up window with the selection is missing and doesn't proceed with the hatching command for options 2 and 3.

 

Screen shot below is when it was working.

I've attached the routine

revcloudhatch1.jpg

revcloudhatch2.jpg

Thanks

 

 

 

0 Likes
1,582 Views
5 Replies
Replies (5)
Message 2 of 6

ronjonp
Mentor
Mentor

Just tested here and seemed to work. Are you familiar with the builtin REVCLOUD command? It's a bit more user friendly when you need to modify the shape of the cloud.

 

If you are not seeing your options on the screen, set DYNMODE to 1 otherwise it will prompt on the command line.

 

2019-07-29_16-43-24.gif

0 Likes
Message 3 of 6

spartan_vng
Enthusiast
Enthusiast

thks rperez.

 

My dynmode was set to -1 for some reason.....hence couldn't see the menu.

I was trying to run it through the command line and from there is where I found that the routine didn't create the layer and didn't continue with the hatching.

Reason for doing this is to control layer colour, naming and clouding standardization amongst the user at my company.

0 Likes
Message 4 of 6

ronjonp
Mentor
Mentor

I get that .. one thing I'd definitely change to simplify your code / make it reusable is create subfunctions that you can pass arguments to. You have createlayerdef 1 - 6 but really only need one function and then feed it the correct arguments based on your options selected. It appears that only the name and color change for your layers.

Example:

 

(defun createlayerdef (name color)
  (entmake (list '(0 . "LAYER")
		 '(100 . "AcDbSymbolTableRecord")
		 '(100 ."AcDbLayerTableRecord")
		 (cons 2 name)
		 (cons 62 color)
		 '(70 . 0)
		 '(6 "Continuous")
		 '(370 . 18)
	   )
  )
)
;; Def2
(createlayerdef "REV_DOTS" 1)
;; Def3
(createlayerdef "REV_DEMO" 250)
;; Def4
(createlayerdef "REV_INT" 6)
;; etc

Also, localize all your variables .. this can cause many headaches :

(defun c:rch (/ *error* anslayer anshatch llocalgen typ ch ATT M:ANG M:BM M:CLS M:CNT M:DST M:OER M:OM M:P1 M:P2 M:PL M:SC PAUSE PP SC SS TXH)

 

 

 

 

0 Likes
Message 5 of 6

spartan_vng
Enthusiast
Enthusiast

ok thanks. I'm not familiar with any type of programming what so ever, so I'll need some time to digest this a bit to see if I understand.  The original code was from 2 different sources which I merged to get what I have now..... I'm lucky that it even worked for me to begin with...lol. I guess I'll need to read up on lisp programming.

 

I take a stab at fixing it and repost if I get it working...wish me luck.

 

cheers

0 Likes
Message 6 of 6

Sea-Haven
Mentor
Mentor

Just a suggestion (defun createlayer (color name ltype) assoc 6

 

createlayer1 (name)

createlayer2 (name color)

createlayer3 (name color ltype)

 

0 Likes