Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Revcloud and Delta routine.

20 REPLIES 20
SOLVED
Reply
Message 1 of 21
Ironbat5
4054 Views, 20 Replies

Revcloud and Delta routine.

I'm trying to create a lisp routine where It will create a layer for the delta that is needed and at the same time adds the delta. I get delta revisions often and it takes time to add a new layer and a new delta for each plan. I would like to create a routine that creates the the new layer based on the revision number.

 

For example if I get a revision 2 I would like to have a lisp routine that creates a new layer but asks what number i would like to use, once the new layer gets created the revcloud command would run, I use polylines around my revisions then change them to cloud with the revcloud command. after i pick my polylines to be changed to clouds then it would add a delta block that is in an attribute and it lets me put the number of the revision i want. At the end I would have a new layer, a cloud around my revision and a delta corresponding to the revision number i'm currently working with.

 

I have a routine that creates the new layer, sets it current, and starts the revcloud command where i can pick the objects to change to clouds, after that I'm stuck, I'm not sure how to tell AutoCAD that after the selection is made to start the insert command to insert that delta attribute block. I mean the routine ends after i pick my objects, I tried doint the delta first but i ran into the same issue since my routine ends after AutoCAD ask me to pick a location to put my delta block.

 

I need to figure a way to tell AutoCAD that after something is picked or selected then to continue with the lisp routine without ending it. I atteched an example of what I have for anyone to review. Any help is highly apprecitaed and thanks in advance.

20 REPLIES 20
Message 21 of 21
Baker_ADG
in reply to: isosa9APBT

I piecemailed my research to get me this.. 

 

(DEFUN C:RVC (/ *Error*)

  (defun *Error* (strErr)
    (setvar "TextEval" txtev)
    (SETVAR 'OSMODE #OSM)
    (setvar "expert" ept)
    (setvar "CmdEcho" echo)
    (setvar "clayer" lay1)
    (setvar "attdia" rc1)
    (setvar "attreq" rc2)
    (princ)
  ) ;_ closes ERROR EXCEPTION defun

  (setq					;saves current SYSTEM VARIABLES
    #OSM  (GETVAR 'OSMODE)
    echo  (getvar "CmdEcho")
    txtev (getvar "TextEval")
    ept	  (getvar "expert")
    lay1  (getvar "clayer")
    rc1	  (getvar "attdia")
    rc2	  (getvar "attreq")
  )

;;;  =================================== Sets the current System Variables

  (command "_.UNDO" "Group")
  (setvar "attdia" 0)
  (setvar "attreq" 1)
  (SETVAR 'OSMODE 0)
  (SETVAR 'CMDECHO 0)
  (SETVAR 'TEXTEVAL 1)
  (SETVAR 'EXPERT 4)



;;;  ===================================
  (if (= plc nil)
    (setq plc 1)
    (SETQ PLC TMP1)
  )
  (princ "\nWhat is the Current Revision: <")
  (princ plc)
  (princ ">: ")
  (setq tmp1 (getint))
  (if (/= tmp1 nil)
    (setq plc tmp1)
  )

  (setq
    tmp1 plc
    a1	 (abs plc)
    a2	 (rtos a1 2 0)
    a3	 (strcat "-REV" a2)

  )


;;;  =================================== Sets the current layer
  (if (tblsearch "layer" a3)
					;if true then...
    (setvar "clayer" a3)

					;if false, then
    (command "._LAYER" "_MAKE" a3 "_color" "10" a3 "")

  )					;end IF

;;;  =================================== Creates Revcloud
  (setvar 'REVCLOUDMINARCLENGTH 0.125)
  (setvar 'REVCLOUDMAXARCLENGTH 0.125)
  (SETVAR 'CMDECHO 1)
  (initcommandversion)
  (command-s "._revcloud"
;    "A" 0.125 ""
    PAUSE )
  (SETVAR 'CMDECHO 0)


;;;  =================================== Inserts Revision Delta
  (setq	pt (getpoint
	     "\nPick insertion point for the Revision Triangle: "
	   )
  )
  (command
    "_.insert"
    "../../00_CAD Library/06_Blocks/06.04_Civil Design/ZE-REV.dwg" ;path the revision delta
    pt
    ""
    ""
    ""
    a2
   )



;;;  =================================== Restores Previous Settings
  (setvar "TextEval" txtev)
  (setvar "expert" ept)
  (setvar "CmdEcho" echo)
  (setvar "clayer" lay1)
  (setvar "attdia" rc1)
  (setvar "attreq" rc2)
  (SETVAR 'OSMODE #OSM)


;;;  =================================== Closes LISP
  (*error* nil)
  (princ)				;quiet exit

)

It creates "_rev#" layer in color 10.

inserts the revcloud and block on that layer, then reverts the layer to the previously current layer. 

Jon Baker | Land Development & Infrastructure Design Manager
Alignment Design Group | Denver | Colorado
Civil 3D 2021 | Windows 10

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost