Jump to content

Recommended Posts

Posted

Does anybody has a lisp created for producing setting out information?

 

We usually copy a block into a drawing and number them onscreen. Then we draw a pline to connect them and list the pline to copy the coords to Excel. We usually sent a pdf of the drawing with the number marked on it to site.

 

Can anyone offer a better suggestion as to how we might do it?

  • Replies 22
  • Created
  • Last Reply

Top Posters In This Topic

  • woodman78

    12

  • Lee Mac

    4

  • eldon

    2

  • Least

    2

Top Posters In This Topic

Posted Images

Posted

As in where to place offset pegs etc? Can't you just export the coordinates of the setout points (from AutoCad or any other civil/survey package) and that is all that is needed to setout the job?

Posted

I have a block and I'm using LeeMac's very cool NumInc3.1 to insert the block with an incremental number. I am wondering how I can list the X,Y for all the blocks of a certain name based on the ascending incremental number? Or does anyone have anything already for doing this? I looked at LeeMac's PointManager but it seems it is designed for the reverse of what I want.

 

Thanks

Posted

I found this thread which gets me almost to where i want to go.

http://www.cadtutor.net/forum/showthread.php?31653-Lisp-coordinates-of-points-to-excel-sheet-%28-point-number%29

This works fine if i place the points in with mtext because it detects the text and i can sort them in excel. Problem I have is how to number them in CAD.setting out.png

If I insert blocks like this that explode on insertion so that I am left with the red symbol which is a block and Mtext how do I transform the "x's" into numbers by choosing them. Can someone create a lisp that when I select the text it will become 1 and the next one I select will become 2 etc.?

 

Sorry I;m all over the place on this but I'm under pressure with a lot of drawings to do so I'm looking for a solution.

Posted
I have a block and I'm using LeeMac's very cool NumInc3.1 to insert the block with an incremental number. I am wondering how I can list the X,Y for all the blocks of a certain name based on the ascending incremental number?

 

Have you tried to use the AutoCAD Attribute Extraction? You have a block whose attribute is the number. The Attribute extraction will add on the insertion point coordinates to the number to give a very nice csv file :D

Posted

This was fun to write, maybe it will help:

 

(defun c:test ( / block def el en ent file in lst pt ss str tag tags val )
   (while
       (not
           (or
               (eq "" (setq block (getstring t "\nBlock Name to Extract: ")))
               (and
                  (setq def (tblsearch "BLOCK" block))
                  (= 2 (logand 2 (cdr (assoc 70 def))))
               )
           )
       )
       (princ "\nBlock not Attributed or not Found.")
   )

   (if (not (eq "" block))
       (if
           (setq ss
               (ssget "_X"
                   (list
                       (cons 0 "INSERT")
                       (cons 2 block)
                       (cons 66 1)
                       (cons 410 (if (= 1 (getvar 'CVPORT)) (getvar 'CTAB) "Model"))
                   )
               )
           )
           (progn
               (setq ent (tblobjname "BLOCK" block))
               (while (setq ent (entnext ent))
                   (if (eq "ATTDEF" (cdr (assoc 0 (entget ent))))
                       (setq tags (cons (strcase (cdr (assoc 2 (entget ent)))) tags))
                   )
               )
               (while
                   (not
                       (member
                           (setq tag
                               (strcase
                                   (cond
                                       (   (eq ""
                                               (setq tag
                                                   (getstring
                                                       (strcat "\nTag to Sort by <" (last tags) ">: ")
                                                   )
                                               )
                                           )
                                           (last tags)
                                       )
                                       (   tag   )
                                   )
                               )
                           )
                           tags
                       )
                   )
                   (princ "\nAttribute not found in Block.")
               )
               (if (setq file (getfiled "Output File" "" "txt;csv" 1))
                   (progn
                       (repeat (setq in (sslength ss))
                           (setq en (ssname ss (setq in (1- in)))
                                 pt (cdr (assoc 10 (entget en)))
                                 val nil
                           )
                           (while
                               (and
                                   (null val)
                                   (eq "ATTRIB"
                                       (cdr
                                           (assoc 0
                                               (setq el
                                                   (entget
                                                       (setq en (entnext en))
                                                   )
                                               )
                                           )
                                       )
                                   )
                               )
                               (if (eq (strcase (cdr (assoc 2 el))) tag)
                                   (setq val (cdr (assoc 1 el)))
                               )
                           )
                           (if val
                               (setq lst (cons (cons val pt) lst))
                           )
                       )
                       (if (setq file (open file "w"))
                           (progn
                               (foreach line (vl-sort lst '(lambda ( a b ) (< (atof (car a)) (atof (car b)))))
                                   (setq str (car line))
                                   (foreach x (cdr line)
                                       (setq str (strcat str "," (rtos x)))
                                   )
                                   (write-line str file)
                               )
                               (setq file (close file))
                           )
                           (princ "\nUnable to Open Chosen File.")
                       )
                   )
                   (princ "\n*Cancel*")
               )
           )
           (princ "\nNo Blocks Found.")
       )
   )
   (princ)
)

Posted

Seriously cool LeeMac. Thanks. One question about your NumInc3.1 and that is that when I have osnap setting on the blocks won't snap to a line. is there something I am doing wrong?

Posted
One question about your NumInc3.1 and that is that when I have osnap setting on the blocks won't snap to a line. is there something I am doing wrong?

 

Object Snap (and all other standard AutoCAD functionality, such as Tracking etc) is not available in 'Dynamic Mode' (due to the grread loop).

 

This should be described in the Dynamic Mode description.

Posted

Lee as usual has done a great job but run step two and bring them back from the csv for placement in the drawing for hard copy viewing when on site.

 

If you want the code just ask.

Posted

So does anyone have a lisp to increment an attribute in a block when inserting? Our LeeMac do older versions of NumInc allow snap to be used?

Thanks.

Posted
Or LeeMac do older versions of NumInc allow snap to be used?

 

Did you even read the Description that I linked you to?

 

I'll quote it here for you:

 

Note: As a result of the method used to display the real-time preview, Dynamic Mode restricts the use of standard AutoCAD functionality such as Object Snap, Orthomode, Tracking etc. To enable such functionality, uncheck the 'Text Follows Cursor' option at the top-left corner of the dialog.
Posted

I admit no. I was running out the door of the office yesterday when I saw the message. Thanks.

Posted

The last part of this setting out info that I want to do is to insert a block with an attrib. I have a lisp to insert it but I want to bypass the reuqest to assign a value to attrib. I want to leave it as the default value. How do I do this?

 

(defun c:setoutinsert (/ SUCE  SUOM  SUSM SUAB SUAD MIDPT PLEN
                  PT01  PT02 a b Color INPT)

 (setq SUOM (getvar "orthomode"))
 (setq SUSM (getvar "osmode"))
 (setq SUAB (getvar "angbase"))
 (setq SUAD (getvar "angdir"))
 (setq SUCL (getvar "clayer"))
 (setq SUCR (getvar "cecolor"))

 (command "_.-layer" "_M" "CCC_LAYOUT_Setting_Out_info" "_C" "2" "CCC_LAYOUT_Setting_Out_info" "_LW" "0.3" "CCC_LAYOUT_Setting_Out_info" "" )
 (command "_-color"  "bylayer")
 (command "._-linetype"  "s"  "bylayer" "")
 (setq INPT (getpoint "\Get insertion point:"))
 (command "_.insert" "set_out_info" INPT "1" "1" "0")
 (setvar "angbase" 0.0000)
 (setvar "angdir"  0)
 (setvar "orthomode" 0)
 (setvar "osmode"    16383)
  ; (setvar "osmode" 0)
   (setvar "osmode" 16383)

 (setvar "orthomode" SUOM)
 (setvar "osmode"    SUSM)
 (setvar "angbase"   SUAB)
 (setvar "angdir"    SUAD)
 (setvar "clayer"    SUCL)
 (setvar "cecolor"   SUCR)
 (princ)
)

 

Thanks.

Posted

Doesn't NumInc do what you require? http://lee-mac.com/numinc.html

Just make sure the block you want to use is defined in the drawing and then away you go.

 

if not maybe the attdia variable will help??

Posted
I have a lisp to insert it but I want to bypass the reuqest to assign a value to attrib. I want to leave it as the default value. How do I do this?

 

Perhaps, after getting one attributed block into the drawing, you could be brave and abandon lisp in favour of doing a multiple Copy :shock:

Posted

Wo! wo! wo! That is way outside my comfort zone!!!!.

 

Only messing. That sounds like a good option. Thanks. I was hoping to have it all in the one routine.

Posted

Woodman if your doing setouts why would you not want to keep incrementing the block label you can not set out ten pt 1's your contradicting your initial request.

 

Our pre civ3d was

 

Run lisp1 creates pt labels by picking pt and location of label balloon each time run checks for last pt num used automatically and confirm new start number.

 

Run lisp two extracts all ptno,x,y of all setout blocks to csv file.

 

Run lisp 3 brings csv back in to dwg as plotable table.

 

Am I missing something ?

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