Jump to content

Offset to layer reactor


broncos15

Recommended Posts

I have a question on how to approach a reactor that I am planning on tackling. This will be my first ever reactor, so I have been reading up on the vlr functions. My goal of the reactor is to have it determine if offset is called, with a distance of 0.5 or 2 and the object is on a layer that ends in -FACE or -BACK, then run the reactor and put the newly created object on a particular layer (for example if the distance is 0.5 and the layer is on C-ROAD-CURB-FACE, then put the newly created offset object on C-ROAD-CURB-BACK). I can't figure out how to have the reactor determine both of these criteria because I haven't ever seen an example that checks for both a command and the objects property before. Does anyone have any suggestions on how I should tackle this? Thanks in advance for the help!

Link to comment
Share on other sites

  • Replies 25
  • Created
  • Last Reply

Top Posters In This Topic

  • broncos15

    13

  • Tharwat

    9

  • Grrr

    3

  • BIGAL

    1

Top Posters In This Topic

Hi,

I know that you could do that with plain lisp, by "redefining the offset command" and add some conditioning to it.

I've seen some example reactor from BIGAL, for offset:

for example you type O2 and it offsets with 2 unit distance, type O0-5 and it offsets by 0.5 and so on..

You can check it out, but I don't know will it help you for your reactor.

 

I did some attempts with reactors, but failed.. as Lee Mac told me the reactor code has to be watertight.

Best of luck!

Link to comment
Share on other sites

Hi,

I know that you could do that with plain lisp, by "redefining the offset command" and add some conditioning to it.

I've seen some example reactor from BIGAL, for offset:

for example you type O2 and it offsets with 2 unit distance, type O0-5 and it offsets by 0.5 and so on..

You can check it out, but I don't know will it help you for your reactor.

 

I did some attempts with reactors, but failed.. as Lee Mac told me the reactor code has to be watertight.

Best of luck!

Thanks Grrr. I hadn't thought of redefining offset, I guess it could be accomplished by redefining it so that if the offsetdist system variable is set to 0.5' or 2', then do the necessary code, otherwise, just do the normal offset command. The only problem I foresee is it running into problems with my offset reactor I have running that is pretty similar to BIGAL's.
Link to comment
Share on other sites

Hi,

 

What are the settings of each layer ("C-ROAD-CURB-FACE" and "C-ROAD-CURB-BACK") Color, Ltype and LineWeight ?

I am asking this because the program should create these layers if they are not already existed in your drawing to avoid any error message and failure.

Link to comment
Share on other sites

This is what I've come up with:

(defun c:test ( / *error* cl cmech )

(setq cl (getvar 'CLAYER))
(setq cmech (getvar 'CMDECHO))

(setvar 'CMDECHO 0)
(command "_.offset" "L" "C" "" "E" )
(defun *error* ( msg )
	(if cl (setvar 'CLAYER cl))
	(if cmech (setvar 'CMDECHO cmech))
	(if (not (member msg '("Function cancelled" "quit / exit abort")))
		(princ (strcat "\nError: " msg))
	)
	(princ)
)

(if (not ans) 
	(progn 
		(setq ans "Through")
		(setq ans-p ans)
	)
)	

(initget "Through")
(while   (setq ans (cond ( (getdist (strcat "\nEnter offset distance or [Through] <" ans-p ">: "))) ( ans )))
	
	(progn
		(cond
			((numberp ans)
				(setq ans-p (rtos ans))
			)
			(T
				(setq ans-p ans)
			)
		);cond
		
		(while (not (and (setq ent (car(entsel "\nSelect object to offset: ")))
			(setq layername (cdr (assoc 8 (entget ent))))
		)
		)
		(cond
			(   (= 52 (getvar 'errno))
				(princ "\nYou must select an object.")
			)	   
			(   (null ent)
				(princ "\nYou missed, try again.")
			)
		)
		)
		
		(cond
			( (or (and (= ans 0.5)(wcmatch layername "*-FACE")) (and (= ans 2)(wcmatch layername "*-FACE")) )
				(setvar 'clayer "C-ROAD-CURB-BACK")
				(setq pt (getpoint "\nSpecify side to offset"))
				(command "_.offset" (rtos ans 2 10) ent pt "E" )
				(setvar 'clayer cl)
			)
			( (or (and (= ans 0.5)(wcmatch layername "*-BACK")) (and (= ans 2)(wcmatch layername "*-BACK")))
				(setvar 'clayer "C-ROAD-CURB-FACE")
				(setq pt (getpoint "\nSpecify side to offset"))
				(command "_.offset" (rtos ans 2 10) ent pt "E" )
				(setvar 'clayer cl)
			)
			( (numberp ans)
				(setq pt (getpoint "\nSpecify side to offset"))
				(command "_.offset" (rtos ans 2 10) ent pt "E" )
			)
			( (or (= ans "Through")(= ans "T")(= ans "t"))
				(setq pt (getpoint "\nSpecify side to offset"))
				(command "_.offset" "Through" ent pt "E" )
			)
		);cond
		
	);progn
)
(setvar 'CMDECHO cmech)
(princ)
)		

Note that I'm not a programmer so there might be mistakes.

And yeah, its not a reactor.

Link to comment
Share on other sites

Hi,

 

What are the settings of each layer ("C-ROAD-CURB-FACE" and "C-ROAD-CURB-BACK") Color, Ltype and LineWeight ?

I am asking this because the program should create these layers if they are not already existed in your drawing to avoid any error message and failure.

Tharwat, thanks for the reminder. The settings of the layers are:

Layer Name       |   Description              |    Color    |   Linetype   |    Lineweight    |       Plot       |    Plot Style   
C-PRKG-CURB-FACE  Parking Lots:Curb Face          2        Continuous    0.20                    yes                black
C-PRKG-CURB-BACK  Parking Lots:Curb Back         4        Continuous    0.30                    yes                black
C-PRKG-CURB-EOP   Parking Lots:EOP                   10     Continuous    0.30                    yes                black
C-ROAD-CURB-FACE  Roadways:Curb Face             2        Continuous    0.20                    yes                black
C-ROAD-CURB-BACK  Roadways:Curb Back            4        Continuous    0.30                    yes                black 
C-ROAD-CURB-EOP  Roadways:EOP                       10       Continuous    0.30                    yes                black 

I have begun working on the reactor and this is just my starting point for turning it on or off.

;;;This is the portion of the code that turns the reactor on or off, with the default being on
(if (= nil (getenv "offsetlayerdirector"))
 (setenv "offsetlayerdirector" "1")
)
;;;Turns on the offset layer director if it's been installed, but never run
(defun c:OffsetLayerDirector (/ ans)
 (initget 1 "On oFf")
 (setq ans (getkword "Offset layer director [On/OFF]:"))
 (if (= ans "On")
   (progn
     (setenv "offsetlayerdirector" "1")
     (princ "\nOffset layer director is turned on.")
   )
   (progn
     (setenv "offsetlayerdirector" "0")
     (princ "\nOffset layer director is turned off.")
   )
 )
 (princ)
)

Link to comment
Share on other sites

Grr, thank you so much for the code start! That is definitely a good start for me to mimic the offset command. I still feel like it is going to be really tough to perfectly mimic it perfectly, and I don't think I will be able to use it in conjunction with my other offset reactor, so I'll have to look into it more.

Link to comment
Share on other sites

broncos15,

I modified the code - this version will ask you once for the offset distance and it will continue with entsel and getpoint loop :

(defun c:test ( / *error* cl cmech )

(setq cl (getvar 'CLAYER))
(setq cmech (getvar 'CMDECHO))

(setvar 'CMDECHO 0)
(command "_.offset" "L" "C" "" "E" )
(defun *error* ( msg )
	(if cl (setvar 'CLAYER cl))
	(if cmech (setvar 'CMDECHO cmech))
	(if (not (member msg '("Function cancelled" "quit / exit abort")))
		(princ (strcat "\nError: " msg))
	)
	(princ)
)

(if (not ans) 
	(progn 
		(setq ans "Through")
		(setq ans-p ans)
	)
)	

(initget "Through")
(setq ans (cond ( (getdist (strcat "\nEnter offset distance or [Through] <" ans-p ">: "))) ( ans )))
(while  (and (setq ent (car(entsel "\nSelect object to offset: ")))
	(setq layername (cdr (assoc 8 (entget ent))))
)

(cond
	(   (= 52 (getvar 'errno))
		(princ "\nYou must select an object.")
	)	   
	(   (null ent)
		(princ "\nYou missed, try again.")
	)
)

(progn
	(cond
		((numberp ans)
			(setq ans-p (rtos ans))
		)
		(T
			(setq ans-p ans)
		)
	);cond
	
	
	(cond
		( (or (and ent (= ans 0.5)(wcmatch layername "*-FACE")) (and ent (= ans 2)(wcmatch layername "*-FACE")) )
			(setvar 'clayer "C-ROAD-CURB-BACK")
			(setq pt (getpoint "\nSpecify side to offset"))
			(command "_.offset" (rtos ans 2 10) ent pt "E" )
			(setvar 'clayer cl)
		)
		( (or (and ent (= ans 0.5)(wcmatch layername "*-BACK")) (and ent (= ans 2)(wcmatch layername "*-BACK")))
			(setvar 'clayer "C-ROAD-CURB-FACE")
			(setq pt (getpoint "\nSpecify side to offset"))
			(command "_.offset" (rtos ans 2 10) ent pt "E" )
			(setvar 'clayer cl)
		)
		( (numberp ans)
			(setq pt (getpoint "\nSpecify side to offset"))
			(command "_.offset" (rtos ans 2 10) ent pt "E" )
		)
		( (or (= ans "Through")(= ans "T")(= ans "t"))
			(setq pt (getpoint "\nSpecify side to offset"))
			(command "_.offset" "Through" ent pt "E" )
		)
	);cond
	
	
);progn

)
(if cmech (setvar 'CMDECHO cmech))
(princ)
)		

Consider it. I just wanted to practice! :)

Link to comment
Share on other sites

The variable Offsetdist hold the current value of the offset so I would just write a complete lisp c:Omy or as suggested redefine (big hint) it would be easy to check Offsetdist value and layer of Entlast.

 

Their may be a way of a reactor lastcommand so could do something if it was offset. Check "Cmdnames" may be a starting point.

Link to comment
Share on other sites

Hi,

 

Try this program and let me know how you get on with it.

 

(defun c:Offset2LayerOn  nil
 ;;--------------------------------------------;;
 ;; Author: Tharwat Al Shoufi - Date:06.Apr.16	;;
 ;;============================================;;
 ;; Function reactor to change the layer name	;;
 ;; of the newly created offset objects as per	;;
 ;; Offset distance [0.5 or 2.0] and as in the ;;
 ;; following :				;;
 ;; 0.5 - move to Layer Name: C-ROAD-CURB-FACE	;;
 ;; 2.0 - move to Layer Name: C-ROAD-CURB-BACK	;;
 ;;____________________________________________;;
 (if (not *Offset2LayerReactor*)
   (progn
     (setq *Offset2LayerReactor* (vlr-command-reactor "offset:to:layer"
                                   '((:vlr-commandWillStart . PaveTheGround)
                                     (:vlr-commandended     . GetTheJobDone))))
     (princ "\nReactor < Offset2Layer > Activated !")
     )
   (princ "\nReactor < Offset2Layer > is ALREADY Activated and running.")
   )
 (princ)
 )
;;--------------------------------------------;;
(defun c:Offset2LayerOff  nil
 (if *Offset2LayerReactor*
   (progn
     (vlr-remove *Offset2LayerReactor*)
     (setq *Offset2LayerReactor* nil)
     (princ "\nReactor < Offset2Layer > disabled !")
     )
   (princ "\nReactor < Offset2Layer > is not yet activated to disable !")
   )
 (princ)
 )
;;--------------------------------------------;;
(defun PaveTheGround  (rct arg)
 (if (wcmatch (strcase (car arg)) "*OFFSET*")
   (setq *Reactor:last:entity* (entlast))
   )
 (princ)
 )
;;--------------------------------------------;;
(defun GetTheJobDone  (rct arg / offD lst l)
 (if (and *Reactor:last:entity*
          (or (equal (setq offD (getvar 'OFFSETDIST)) 0.5)
              (equal offD 2.0)
              )
          )
   (while
     (setq *Reactor:last:entity* (entnext *Reactor:last:entity*))
      (setq lst (cons *Reactor:last:entity* lst))
      )
   )
 (setq *Reactor:last:entity* nil)
 (if
   (and lst
        (or (wcmatch (setq l (strcase (cdr (assoc 8 (entget (car lst)))))) "*-FACE")
            (wcmatch l "*-BACK"))
        (setq l (if (= offD 0.5)
                  '((8 . "C-ROAD-CURB-FACE"))
                  '((8 . "C-ROAD-CURB-BACK"))))
        )
    (progn
      (mapcar '(lambda (x)
                 (if (not (tblsearch "LAYER" (car x)))
                   (progn
                     (regapp "AcAecLayerStandard")
                      (entmake
                       (append (list '(0 . "LAYER")
                             '(100 . "AcDbSymbolTableRecord")
                             '(100 . "AcDbLayerTableRecord")
                             (cons 2 (car x))
                             (cons 62 (caddr x))
                             '(6 . "Continuous")
                             (cons 370 (last x))
                             '(290 . 1)
                             '(70 . 0)
                             )
                              (list (list -3
                                   (list "AcAecLayerStandard"
                                         (cons 1000 "")
                                         (cons 1000 (cadr x))
                                         )
                                   )
                             )
                       )
                     )
                   )
                 )
                 )
              (list '("C-ROAD-CURB-FACE" "Roadways:Curb Face" 2 20)
                    '("C-ROAD-CURB-BACK" "Roadways:Curb Back" 4 30)
                    )
              )
      (mapcar '(lambda (x) (entmod (append (entget x) l))) lst)
      )
    )
 (princ)
 )(vl-load-com)
;;--------------------------------------------;;
(princ "\nType Offset2LayerOn to activate. And Offset2LayerOff to disable reactor.")

Link to comment
Share on other sites

Hi,

 

Try this program and let me know how you get on with it.

 

(defun c:Offset2LayerOn  nil
 ;;--------------------------------------------;;
 ;; Author: Tharwat Al Shoufi - Date:06.Apr.16    ;;
 ;;============================================;;
 ;; Function reactor to change the layer name    ;;
 ;; of the newly created offset objects as per    ;;
 ;; Offset distance [0.5 or 2.0] and as in the ;;
 ;; following :                ;;
 ;; 0.5 - move to Layer Name: C-ROAD-CURB-FACE    ;;
 ;; 2.0 - move to Layer Name: C-ROAD-CURB-BACK    ;;
 ;;____________________________________________;;
 (if (not *Offset2LayerReactor*)
   (progn
     (setq *Offset2LayerReactor* (vlr-command-reactor "offset:to:layer"
                                   '((:vlr-commandWillStart . PaveTheGround)
                                     (:vlr-commandended     . GetTheJobDone))))
     (princ "\nReactor < Offset2Layer > Activated !")
     )
   (princ "\nReactor < Offset2Layer > is ALREADY Activated and running.")
   )
 (princ)
 )
;;--------------------------------------------;;
(defun c:Offset2LayerOff  nil
 (if *Offset2LayerReactor*
   (progn
     (vlr-remove *Offset2LayerReactor*)
     (setq *Offset2LayerReactor* nil)
     (princ "\nReactor < Offset2Layer > disabled !")
     )
   (princ "\nReactor < Offset2Layer > is not yet activated to disable !")
   )
 (princ)
 )
;;--------------------------------------------;;
(defun PaveTheGround  (rct arg)
 (if (wcmatch (strcase (car arg)) "*OFFSET*")
   (setq *Reactor:last:entity* (entlast))
   )
 (princ)
 )
;;--------------------------------------------;;
(defun GetTheJobDone  (rct arg / offD lst l)
 (if (and *Reactor:last:entity*
          (or (equal (setq offD (getvar 'OFFSETDIST)) 0.5)
              (equal offD 2.0)
              )
          )
   (while
     (setq *Reactor:last:entity* (entnext *Reactor:last:entity*))
      (setq lst (cons *Reactor:last:entity* lst))
      )
   )
 (setq *Reactor:last:entity* nil)
 (if
   (and lst
        (or (wcmatch (setq l (strcase (cdr (assoc 8 (entget (car lst)))))) "*-FACE")
            (wcmatch l "*-BACK"))
        (setq l (if (= offD 0.5)
                  '((8 . "C-ROAD-CURB-FACE"))
                  '((8 . "C-ROAD-CURB-BACK"))))
        )
    (progn
      (mapcar '(lambda (x)
                 (if (not (tblsearch "LAYER" (car x)))
                   (progn
                     (regapp "AcAecLayerStandard")
                      (entmake
                       (append (list '(0 . "LAYER")
                             '(100 . "AcDbSymbolTableRecord")
                             '(100 . "AcDbLayerTableRecord")
                             (cons 2 (car x))
                             (cons 62 (caddr x))
                             '(6 . "Continuous")
                             (cons 370 (last x))
                             '(290 . 1)
                             '(70 . 0)
                             )
                              (list (list -3
                                   (list "AcAecLayerStandard"
                                         (cons 1000 "")
                                         (cons 1000 (cadr x))
                                         )
                                   )
                             )
                       )
                     )
                   )
                 )
                 )
              (list '("C-ROAD-CURB-FACE" "Roadways:Curb Face" 2 20)
                    '("C-ROAD-CURB-BACK" "Roadways:Curb Back" 4 30)
                    )
              )
      (mapcar '(lambda (x) (entmod (append (entget x) l))) lst)
      )
    )
 (princ)
 )(vl-load-com)
;;--------------------------------------------;;
(princ "\nType Offset2LayerOn to activate. And Offset2LayerOff to disable reactor.")

Wow, thank you Tharwat! Your code is excellent for me to study to learn more about reactors. So I tried to edit the code to include more layer options, but I am getting the malformed list error. My edited code is:
(defun c:Offset2LayerOn  nil
 ;;--------------------------------------------;;
 ;; Author: Tharwat Al Shoufi - Date:06.Apr.16 ;;
 ;;============================================;;
 ;; Function reactor to change the layer name ;;
 ;; of the newly created offset objects as per ;;
 ;; Offset distance [0.5 or 2.0] and as in the ;;
 ;; following :    ;;
 ;; 0.5 - move to Layer Name: C-ROAD-CURB-FACE ;;
 ;; 2.0 - move to Layer Name: C-ROAD-CURB-BACK ;;
 ;;____________________________________________;;
 ;;Edited by Broncos 15 on 4/6/16
 (if (not *Offset2LayerReactor*)
   (progn
     (setq *Offset2LayerReactor* (vlr-command-reactor "offset:to:layer"
                                   '((:vlr-commandWillStart . PaveTheGround)
                                     (:vlr-commandended     . GetTheJobDone))))
     (princ "\nReactor < Offset2Layer > Activated !")
     )
   (princ "\nReactor < Offset2Layer > is ALREADY Activated and running.")
   )
 (princ)
 )
;;--------------------------------------------;;
(defun c:Offset2LayerOff  nil
 (if *Offset2LayerReactor*
   (progn
     (vlr-remove *Offset2LayerReactor*)
     (setq *Offset2LayerReactor* nil)
     (princ "\nReactor < Offset2Layer > disabled !")
     )
   (princ "\nReactor < Offset2Layer > is not yet activated to disable !")
   )
 (princ)
 )
;;--------------------------------------------;;
(defun PaveTheGround  (rct arg)
 (if (wcmatch (strcase (car arg)) "*OFFSET*")
   (setq *Reactor:last:entity* (entlast))
   )
 (princ)
 )
;;--------------------------------------------;;
(defun GetTheJobDone  (rct arg / offD lst l)
 (if (and *Reactor:last:entity*
          (or (equal (setq offD (getvar 'OFFSETDIST)) 0.5)
              (equal offD 2.0)
              )
          )
   (while
     (setq *Reactor:last:entity* (entnext *Reactor:last:entity*))
      (setq lst (cons *Reactor:last:entity* lst))
      )
   )
 (setq *Reactor:last:entity* nil)
 (if
   (and lst
        (or (wcmatch (setq l (strcase (cdr (assoc 8 (entget (car lst)))))) "*-FACE")
            (wcmatch l "*-BACK"))
        (if (= offD 0.5)
          (cond
            ((= l '((8 . "C-ROAD-CURB-BACK")))
             (setq l '((8 . "C-ROAD-CURB-FACE"))))
            ((= l '((8 . "C-ROAD-CURB-FACE")))
             (setq l '((8 . "C-ROAD-CURB-BACK"))))
            ((= l '((8 . "C-PRKG-CURB-FACE")))
             (setq l '((8 . "C-PRKG-CURB-BACK"))))
            ((= l '((8 . "C-PRKG-CURB-BACK")))
             (setq l '((8 . "C-PRKG-CURB-FACE"))))
            ((= l '((8 . "C-DRIV-CURB-BACK")))
             (setq l '((8 . "C-DRIVE-CURB-FACE"))))
            ((= l '((8 . "C-DRIV-CURB-FACE")))
             (setq l '((8 . "C-DRIVE-CURB-BACK"))))
            )
          (cond
            ((= l '((8 . "C-ROAD-CURB-FACE")))
             (setq l '((8 . "C-ROAD-CURB-EOP"))))
            ((= l '((8 . "C-PRKG-CURB-FACE")))
             (setq l '((8 . "C-PRKG-CURB-EOP"))))
            ((= l '((8 . "C-DRIV-CURB-FACE")))
             (setq l '((8 . "C-DRIVE-CURB-EOP"))))
            )
        )
    (progn
      (mapcar '(lambda (x)
                 (if (not (tblsearch "LAYER" (car x)))
                   (progn
                     (regapp "AcAecLayerStandard")
                      (entmake
                       (append (list '(0 . "LAYER")
                             '(100 . "AcDbSymbolTableRecord")
                             '(100 . "AcDbLayerTableRecord")
                             (cons 2 (car x))
                             (cons 62 (caddr x))
                             '(6 . "Continuous")
                             (cons 370 (last x))
                             '(290 . 1)
                             '(70 . 0)
                             )
                              (list (list -3
                                   (list "AcAecLayerStandard"
                                         (cons 1000 "")
                                         (cons 1000 (cadr x))
                                         )
                                   )
                             )
                       )
                     )
                   )
                 )
                 )
              (list '("C-ROAD-CURB-FACE" "Roadways:Curb Face" 2 20)
                    '("C-ROAD-CURB-BACK" "Roadways:Curb Back" 4 30)
                    )
              )
      (mapcar '(lambda (x) (entmod (append (entget x) l))) lst)
      )
    )
 (princ)
 )(vl-load-com)
;;--------------------------------------------;;
(princ "\nType Offset2LayerOn to activate. And Offset2LayerOff to disable reactor.")

Link to comment
Share on other sites

Wow, thank you Tharwat! Your code is excellent for me to study to learn more about reactors.

 

Nice, you are welcome.

 

..... but I am getting the malformed list error.

Regardless of what codes you have added to my program.

That error message indicates that the program missing bracket(s) so check the codes that you have added and add one bracket at the end of them for and function to be closed.

 

Happy coding. :)

Link to comment
Share on other sites

Nice, you are welcome.

 

 

Regardless of what codes you have added to my program.

That error message indicates that the program missing bracket(s) so check the codes that you have added and add one bracket at the end of them for and function to be closed.

 

Happy coding. :)

Thanks Tharwat. I realized that there was an error in my conditional statement as well, so I corrected that.
Link to comment
Share on other sites

Thanks Tharwat. I realized that there was an error in my conditional statement as well, so I corrected that.

 

Not a problem. Just ask if you need any further help.

Link to comment
Share on other sites

Tharwat, so I have tried to make a modification to the layer creation portion of the code so that I can easily input all the different layer properties. My new code is (I haven't input all the layer data yet because I am not sure if it will work). The issue I am having is that I am not very good at mapcar functions and I am confused on how Lee's code works for that.

Edited by broncos15
Redundant code
Link to comment
Share on other sites

If your issue is just related to creating layers and have them existed with the program , just keep Lee's function outside my program and be sure that the program to create layers is loaded prior my program to guarantee the success of the program and not fail due to a layer.

 

This would save you lots of efforts and time.

Link to comment
Share on other sites

If your issue is just related to creating layers and have them existed with the program , just keep Lee's function outside my program and be sure that the program to create layers is loaded prior my program to guarantee the success of the program and not fail due to a layer.

 

This would save you lots of efforts and time.

Thanks Tharwat! I figured out a workaround just using your code. It was a good opportunity for me to learn more about the mapcar function, so thanks again for the help!
Link to comment
Share on other sites

Thanks Tharwat! I figured out a workaround just using your code. It was a good opportunity for me to learn more about the mapcar function, so thanks again for the help!

 

It is my pleasure for sure.

 

Working with mapcar and lambda and how to play with lists is essential matter in AutoLISP.

Link to comment
Share on other sites

It is my pleasure for sure.

 

Working with mapcar and lambda and how to play with lists is essential matter in AutoLISP.

Tharwat, I have another quick question. I have tried to put the plotstyle to black within the entmake function by doing
'(390 . "Black")

This doesn't work though. Do you happen to know why?

Link to comment
Share on other sites

I don't think this should work , but you need to convert the layer object to vla-object then put the plotstyle to Block if your Plot Style Mode is not Color-Dependent and it is Named Plot Style mode.

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...