Author Topic: AECC_Points  (Read 11903 times)

0 Members and 1 Guest are viewing this topic.

rugaroo

  • Bull Frog
  • Posts: 378
  • The Other CAD Guy
AECC_Points
« on: November 19, 2003, 05:02:35 PM »
I need to build a sset of aecpoints and have each point turned into a blk. Here is the old program that I have, but it only takes old R14 point blks.

Code: [Select]
;*************************************************************************
;********************  ELEVATION GRADE TAG UTILITIES  ********************
;                   ******  Edit Date: 04/26/96  ******
;                        *************************
;                        *************************
(defun rtd (r)
  (* 180.0 (/ r pi))
)
;
;
(defun C:TI (/ scl cmd elev desc blk pnt ra1)
  (setvar "cmdecho" 0)
  (setq scl (getvar "ltscale")
        cmd (getvar "cmdecho")
        elev (getstring "\n***Grade Tag Elevation:   ")
        desc (getstring "\n***Grade Tag Descriptor:  ")
  )
  (prompt "\n***Insertion Point & Rotation:")
  (command "insert" "/acad/blocks/gtc" pause scl "" pause elev desc)
  (setq blk (entget (entlast))
        pnt (cdr (assoc 10 blk))
        ra1 (cdr (assoc 50 blk))
  )
  (if (> (* pi 1.5) ra1 (* pi 0.5))
    (progn
      (command "erase" pnt "")
      (setq ra1 (+ 180.0 (/ (* ra1 180.0) pi)))
      (command "insert" "/acad/blocks/gtcl" pnt scl "" ra1 elev desc)
    )
  )
  (prin1)
)

;****************************************************************************

(defun C:TF (/ scl itm lst typ ins rot at1 elv at2 dsc)
  (setq scl (getvar "ltscale")
        itm (car (entsel "\nSelect Tag:"))
        lst (entget itm)
        typ (cdr (assoc 2 lst))
  )
  (if (or (= "GTCL" typ) (= "GTC" typ))
      (progn
        (setq ins (cdr (assoc 10 lst))
              rot (+ 180 (rtd (cdr (assoc 50 lst))))
              at1 (entget (entnext itm))
              elv (cdr (assoc 1 at1))
              at2 (entget (entnext (entnext itm)))
              dsc (cdr (assoc 1 at2))
        )
        (command "erase" itm "")
        (if (= "GTCL" typ)
            (command "insert" "gtc" ins scl "" rot elv dsc)
        )
        (if (= "GTC" typ)
            (command "insert" "gtcl" ins scl "" rot elv dsc)
        )
      )
      (prompt "\n*** Please Select only Grade Tags ***")
  )
  (prin1)
)

;****************************************************************************

(defun C:T2P (/ scl bas num tag tst el1 el2 dsc ins)
  (setq scl (getvar "ltscale"))
  (initget 1)
  (setq bas (getint "\n** Enter Base Elevation:  "))
  (initget 1)
  (setq num (getint "\n** Enter Beginning Point Number:   ")
        tag T
  )
  (while (/= nil tag)
    (setq tag (car (entsel "\n* Select Tag for Conversion:")))
      (if (/= nil tag) (setq tst (cdr (assoc 2 (entget tag)))))
      (if (not (or (= "GTC" tst) (= "GTCL" tst) (= nil tst)))
          (prompt "\n*****Selected Entity Must be GTC or GTCL Tag Block*****")
      )
      (if (or (= "GTC" tst) (= "GTCL" tst))
          (progn
            (setq el1 (cdr (assoc 1 (entget (entnext tag))))
                  el2 (rtos (+ bas (atof el1)) 2 2)
                  dsc (cdr (assoc 1 (entget (entnext (entnext tag)))))
                  ins (cdr (assoc 10 (entget tag)))
                  tst nil
            )
            (command "insert" "point" ins scl "" "" el2 num dsc)
            (setq num (1+ num))
          )
      )
  )
  (prin1)
)

;****************************************************************************

(defun C:P2T (/ scl pnt tst ins elv dsc ln1 dif rt1 rt2)
  (setq scl (getvar "ltscale")
        pnt (car (entsel "\n**Select Point"))
        tst (cdr (assoc 2 (entget pnt)))
  )
  (if (/= "point" tst)
      (prompt "\n*****Selected Entity Must be Acad Point*****")
      (progn
        (setq ins (cdr (assoc 10 (entget pnt)))
              elv (cdr (assoc 1 (entget (entnext pnt))))
              dsc (cdr (assoc 1 (entget (entnext (entnext (entnext pnt))))))
              ln1 (strlen elv)
        )
        (if (> ln1 5)
            (progn
              (setq dif (- ln1 4)
                    elv (substr elv dif)
                    elv (strcat ""elv"")
              )
            )
            (setq elv (strcat ""elv""))
        )
        (command "insert" "/acad/blocks/gtc" ins scl "" pause elv dsc)
        (setq rt1 (cdr (assoc 50 (entget (entlast)))))
        (if (> (* 1.5 pi) rt1 (* 0.5 pi))
            (progn
              (command "erase" (entlast) "")
              (setq rt2 (rtd (+ rt1 pi)))
              (command "insert" "/acad/blocks/gtcl" ins scl "" rt2 elv dsc)
            )
        )
      )
  )
  (prin1)
)

;****************************************************************************
;****************************************************************************



Can you guys please help?

Rug
LDD06-09 | C3D 04-19 | Infraworks 360 | VS2012-VS2017

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
AECC_Points
« Reply #1 on: November 19, 2003, 05:16:33 PM »
OK, I'm curious Rug, why? AECC points are better than blocks.
TheSwamp.org  (serving the CAD community since 2003)

rugaroo

  • Bull Frog
  • Posts: 378
  • The Other CAD Guy
AECC_Points
« Reply #2 on: November 19, 2003, 05:27:10 PM »
Stupid 'Company Standards'
LDD06-09 | C3D 04-19 | Infraworks 360 | VS2012-VS2017

daron

  • Guest
AECC_Points
« Reply #3 on: November 19, 2003, 05:29:41 PM »
Revolt! Sometimes companies need to be shown where the light is. Truely, standards shouldn't be static, they should be flexible and open to discussion and new ideas, unless you work for the gov't, like Mark.

rugaroo

  • Bull Frog
  • Posts: 378
  • The Other CAD Guy
AECC_Points
« Reply #4 on: November 19, 2003, 05:41:28 PM »
Believe me, I have tried, but they will nor allow it until it is required by our entities.
LDD06-09 | C3D 04-19 | Infraworks 360 | VS2012-VS2017

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
AECC_Points
« Reply #5 on: November 19, 2003, 06:12:03 PM »
Ok, so what info do you want to retrieve from the AECC points?
TheSwamp.org  (serving the CAD community since 2003)

rugaroo

  • Bull Frog
  • Posts: 378
  • The Other CAD Guy
AECC_Points
« Reply #6 on: November 19, 2003, 06:17:08 PM »
The only info is the descriptor, and the elevation. If the point reads 1999.82, all I am going to need is the 99.82 portion.

After that the block gtc or gtcl will be inserted at the point with the descriptor, and elevation.
LDD06-09 | C3D 04-19 | Infraworks 360 | VS2012-VS2017

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
AECC_Points
« Reply #7 on: November 19, 2003, 06:19:45 PM »
> If the point reads 1999.82, all I am going to need is the 99.82 portion.

Some how I knew you were going to say that!

Tell ya what, if I give you code that extracts the data from the AECC point can you insert that into the block?
TheSwamp.org  (serving the CAD community since 2003)

rugaroo

  • Bull Frog
  • Posts: 378
  • The Other CAD Guy
AECC_Points
« Reply #8 on: November 19, 2003, 06:21:19 PM »
Well, if you give me something that can extract the point data, and leave the original elevation, then I will be able to use the lower.lsp prog you gave me a while back.
LDD06-09 | C3D 04-19 | Infraworks 360 | VS2012-VS2017

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
AECC_Points
« Reply #9 on: November 19, 2003, 06:21:45 PM »
BTW, are you going to select the points or do a block for ALL of the points.
TheSwamp.org  (serving the CAD community since 2003)

rugaroo

  • Bull Frog
  • Posts: 378
  • The Other CAD Guy
AECC_Points
« Reply #10 on: November 19, 2003, 06:23:35 PM »
I know selecting each block individually would be a pain to figure out, so might as well do it with all points selected at once, and then have a single blk inserted for all of them, and then if I need to change the blks rotation, I can mirrtext and then mirror the blk.
LDD06-09 | C3D 04-19 | Infraworks 360 | VS2012-VS2017

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
AECC_Points
« Reply #11 on: November 19, 2003, 06:26:46 PM »
So we're going to do a
(setq ss (ssget '((0 . "AECC_POINT"))))
TheSwamp.org  (serving the CAD community since 2003)

rugaroo

  • Bull Frog
  • Posts: 378
  • The Other CAD Guy
AECC_Points
« Reply #12 on: November 19, 2003, 06:29:33 PM »
Correct....
LDD06-09 | C3D 04-19 | Infraworks 360 | VS2012-VS2017

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
AECC_Points
« Reply #13 on: November 19, 2003, 06:33:41 PM »
okay here we go......... be back soon.
TheSwamp.org  (serving the CAD community since 2003)

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
AECC_Points
« Reply #14 on: November 19, 2003, 08:04:52 PM »
Code: [Select]
;;; example (setq p-data (pt_data))
    ;;; all data based on AECC points in the dwg NOT the database
    (defun pt_data (/ PointData ss output)
      (gc)
      (defun PointData (ss / ent)
        (cond
          ((setq ent (ssname ss 0))
           (setq output ; <-- global variable
                  (cons
                    (list
                      (cdr (assoc 90 (entget ent)))           ; point number
                      (cdr (assoc 10 (entget ent)))           ; insertion point
                      (car (reverse (assoc 11 (entget ent)))) ; elev
                      (cdr (assoc 303 (entget ent)))          ; description
                      )
                    output
                    ) ; cons
                 ) ; setq
           (PointData (ssdel ent ss))
           )
          (T nil)
          ) ; cond
        ) ; defun PointData
      ;; (1 (480.127 760.395 0.0) 12.0 "top of bank") *sample*

      (if (setq ss (ssget '((0 . "AECC_POINT"))))
        (PointData ss)
        ) ; if
      output
      ) ; defun
TheSwamp.org  (serving the CAD community since 2003)