+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Super Member
    Computer Details
    woodman78's Computer Details
    Operating System:
    Win XP
    Computer:
    Dell GX280
    Discipline
    Transport
    woodman78's Discipline Details
    Occupation
    Road Design Engineer
    Discipline
    Transport
    Details
    I work in a local authority design office with a staff of 13. We carry out road schemes ranging from overlays up to 2 km long new schemes.
    Using
    Civil 3D 2011
    Join Date
    Jul 2009
    Location
    Ireland
    Posts
    771

    Default Pause a lisp to interact with a dynamic block and then resume the lisp

    Registered forum members do not see this ad.

    Hi,
    I have a lisp to create tactile paving either by selecting a closed polyline or by drawing a polyline. I want to insert a dynamic block to form construction lines for the tactile paving in the draw option but I want to be able to adjust the block to suit the local conditions and then resume the command and draw along the block outline. Can anyone guide me with this?

    Code:
    (defun C:Proposed_Tactile_Red (/ ang coords elist midp offsetted offsetted1 ofpt p1 p2 p3 pline side SUCE SUOM SUSM SUAB SUAD SUCL SUCR)
    (setq SUCE (getvar "cmdecho"))
      (setq SUOM (getvar "orthomode"))
      (setq SUSM (getvar "osmode"))
      (setq SUAB (getvar "angbase"))
      (setq SUAD (getvar "angdir"))
      (setq SUCL (getvar "clayer"))
      (setq SUCR (getvar "cecolor"))
    
    
    (setq vl1 (list
    		(cons 0 "LAYER")		;Name of entity
    		(cons 100 "AcDbSymbolTableRecord")					;Open Records
    		(cons 100 "AcDbLayerTableRecord")					;Locate Layer Table
    		(cons 2 "CCC_LAYOUT_Proposed_Tactile_Paving_Red_Solid_Hatch")			;Name of Layer
    		(cons 6 "Continuous")						;Linetype
    		(cons 62 253)							;colour = light grey
    		(cons 70 0)							;state
    		(cons 290 1)							;1=plot, 0=Don't plot
    			)							;End of entity list
    		)
    		(entmake vl1)
    
    (setq vl1 (list
    		(cons 0 "LAYER")		;Name of entity
    		(cons 100 "AcDbSymbolTableRecord")					;Open Records
    		(cons 100 "AcDbLayerTableRecord")					;Locate Layer Table
    		(cons 2 "CCC_LAYOUT_Proposed_Tactile_Paving_Red_Hex_Hatch")			;Name of Layer
    		(cons 6 "Continuous")						;Linetype
    		(cons 62 7)							;colour = light grey
    		(cons 70 0)							;state
    		(cons 290 1)							;1=plot, 0=Don't plot
    			)							;End of entity list
    		)
    		(entmake vl1)
    (setq vl1 (list
    		(cons 0 "LAYER")		;Name of entity
    		(cons 100 "AcDbSymbolTableRecord")					;Open Records
    		(cons 100 "AcDbLayerTableRecord")					;Locate Layer Table
    		(cons 2 "CCC_LAYOUT_Proposed_Tactile_Paving_Red_Outline")			;Name of Layer
    		(cons 6 "Continuous")						;Linetype
    		(cons 62 7)							;colour = light grey
    		(cons 70 0)							;state
    		(cons 290 1)							;1=plot, 0=Don't plot
    			)							;End of entity list
    		)
    		(entmake vl1)
    (setq vl1 (list
    		(cons 0 "LAYER")		;Name of entity
    		(cons 100 "AcDbSymbolTableRecord")					;Open Records
    		(cons 100 "AcDbLayerTableRecord")					;Locate Layer Table
    		(cons 2 "CCC_LAYOUT_Proposed_Tactile_Paving_Red_Construction")			;Name of Layer
    		(cons 6 "Continuous")						;Linetype
    		(cons 62 7)							;colour = light grey
    		(cons 70 0)							;state
    		(cons 290 1)							;1=plot, 0=Don't plot
    			)							;End of entity list
    		)
    		(entmake vl1)
    
    (command "_.-layer" "_C" "_T" "255,204,204" "CCC_LAYOUT_Proposed_Tactile_Paving_Red_Solid_Hatch" "")
    (command "_.-layer" "_LW" "0" "CCC_LAYOUT_Proposed_Tactile_Paving_Red_Outline" "")
    (command "_.-layer" "_LW" "0" "CCC_LAYOUT_Proposed_Tactile_Paving_Red_Hex_Hatch" "")
    (setvar "clayer" "CCC_LAYOUT_Proposed_Tactile_Paving_Red_Solid_Hatch")  
    (setvar "cecolor" "1")
    
    (initget "D S")
    (setq option (getkword "\nChoose to Draw a boundary or Select a boundary: [D/S]: "))
    (cond     ((= option "D")(Proposed_Tactile_Red_draw))
    	((= option "S")(Proposed_Tactile_Red_select))
    )
    )
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    (defun Proposed_Tactile_Red_select ()
    (setq pline(entsel "\nSelect a closed polyline boundary: "))
    (Proposed_Tactile_Red_resume)
    )
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    (defun Proposed_Tactile_Red_draw ()
    (princ "\nPlace the construction block in the correct location and adjust to suit the local conditions. ")
    (setvar "clayer" "CCC_LAYOUT_Proposed_Tactile_Paving_Red_Construction")  
    (command "_.insert" "Red_Tactile_Construction" "_scale" "1" pause "")
    (princ "\nDraw an outline for red tactile paving: ")
    (setvar "cecolor" "1") 
    (setvar "plinegen" 1)
    (command "._pline")
    (while (= 1 (logand 1 (getvar "cmdactive")))
    (command pause))
    (setq pline (entlast)
    elist (entget pline)
    )
    (setvar "cecolor" "Bylayer")  
    (command "_.draworder" pline "" "_F");<--set pline's draw order to front  
    (command "_change" pline ""  "p" "Layer" "CCC_LAYOUT_Proposed_Tactile_Paving_Red_Outline" "color" "Bylayer" "")
    (Proposed_Tactile_Red_resume)
    )
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    (defun Proposed_Tactile_Red_resume ()
    ;(command "._pedit" pline "_W" 0.1 "")
    (setq coords (vl-remove-if (function not)
    (mapcar (function (lambda (x)
    (if (= 10 (car x))(cdr x))))
    elist))
    )
    (setq p2 (car coords)
    midp (mapcar (function (lambda( a b)(/ (+ a b) 2)))
    p1 p2)
    )
      (setvar "cecolor" "Bylayer") 
      (setvar "hpname" "Solid")
      ;(setvar "hpang" 45)
      ;(setvar "hpscale" 0.2)
      (command "-hatch" "S" pline "" "")
    
    (setvar "clayer" "CCC_LAYOUT_Proposed_Tactile_Paving_Red_Hex_Hatch") 
      (setvar "hpname" "hex")
      ;(setvar "hpang" 45)
      (setvar "hpscale" 0.035)
      (command "-hatch" "S" pline "" "")
    
    (command "_change" pline ""  "p" "Layer" "CCC_LAYOUT_Proposed_Tactile_Paving_Red_Outline" "color" "Bylayer" "")
    ;(command "_.-layer" "_OFF" "CCC_LAYOUT_Proposed_Tactile_Paving_Red_Outline" "")
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
     
      (setvar "cmdecho" SUCE)
      (setvar "orthomode" SUOM)
      (setvar "osmode" SUSM)
      (setvar "angbase" SUAB)
      (setvar "angdir" SUAD)
      (setvar "clayer" SUCL)
      (setvar "cecolor" SUCR)
    (princ) 
    )
    Red_Tactile_Construction.dwg

  2. #2
    Quantum Mechanic
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    10,402

    Default

    If you draw the outline first and save the object etc can you then insert your Red_tac.. and use those properties to set the block. Not sure how you eidt it ?

    I dont use dynaic blocks enough to comment maybe do this as a little lisp to test.
    A man who never made mistakes never made anything

  3. #3
    Super Member
    Computer Details
    woodman78's Computer Details
    Operating System:
    Win XP
    Computer:
    Dell GX280
    Discipline
    Transport
    woodman78's Discipline Details
    Occupation
    Road Design Engineer
    Discipline
    Transport
    Details
    I work in a local authority design office with a staff of 13. We carry out road schemes ranging from overlays up to 2 km long new schemes.
    Using
    Civil 3D 2011
    Join Date
    Jul 2009
    Location
    Ireland
    Posts
    771

    Default

    Thanks Bigal but not quite what I was looking for.

  4. #4
    Super Member
    Computer Details
    woodman78's Computer Details
    Operating System:
    Win XP
    Computer:
    Dell GX280
    Discipline
    Transport
    woodman78's Discipline Details
    Occupation
    Road Design Engineer
    Discipline
    Transport
    Details
    I work in a local authority design office with a staff of 13. We carry out road schemes ranging from overlays up to 2 km long new schemes.
    Using
    Civil 3D 2011
    Join Date
    Jul 2009
    Location
    Ireland
    Posts
    771

    Default

    I made some progress on this in that now the block is inserted and the command pauses and then when I click again it continues on as it should. The only problem is that when it pauses it doesn't allow interaction with the dynamic block.

    Can anyone help?


    Code:
    (defun Proposed_Tactile_Red_draw ()
    (princ "\nPlace the construction block in the correct location and adjust to suit the local conditions. ")
    (setvar "clayer" "CCC_LAYOUT_Proposed_Tactile_Paving_Red_Construction")  
    (command ".-Insert" "Red_Tactile_Construction" pause "1" "1" "0" pause pause)
    ;(command "_.insert" "Red_Tactile_Construction" "_scale" "1" pause "")
    (princ "\nDraw an outline for red tactile paving: ")
    (setvar "cecolor" "1") 
    (setvar "plinegen" 1)
    (command "._pline")
    (while (= 1 (logand 1 (getvar "cmdactive")))
    (command pause))
    (setq pline (entlast)
    elist (entget pline)
    )
    (setvar "cecolor" "Bylayer")  
    (command "_.draworder" pline "" "_F");<--set pline's draw order to front  
    (command "_change" pline ""  "p" "Layer" "CCC_LAYOUT_Proposed_Tactile_Paving_Red_Outline" "color" "Bylayer" "")
    (Proposed_Tactile_Red_resume)
    )

  5. #5
    Super Member
    Computer Details
    woodman78's Computer Details
    Operating System:
    Win XP
    Computer:
    Dell GX280
    Discipline
    Transport
    woodman78's Discipline Details
    Occupation
    Road Design Engineer
    Discipline
    Transport
    Details
    I work in a local authority design office with a staff of 13. We carry out road schemes ranging from overlays up to 2 km long new schemes.
    Using
    Civil 3D 2011
    Join Date
    Jul 2009
    Location
    Ireland
    Posts
    771

    Default

    Registered forum members do not see this ad.

    Is there some way to pause the lisp to interact with the dynamic block and then resume on right click?

Similar Threads

  1. Dynamic Block and Lisp
    By Andrew1979 in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 26th Apr 2014, 05:06 am
  2. Running a lisp Command from VBA with a pause
    By metal_pro in forum .NET, ObjectARX & VBA
    Replies: 0
    Last Post: 22nd Jun 2010, 04:58 pm
  3. Lisp & Dynamic Block
    By REID7800 in forum AutoLISP, Visual LISP & DCL
    Replies: 61
    Last Post: 20th May 2010, 12:31 pm
  4. Could Lisp pause untill excel closed?
    By asos2000 in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 17th May 2010, 07:42 pm
  5. LISP and Dynamic Block
    By guitarguy1685 in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 7th Jan 2010, 09:26 am

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts