Author Topic: ( C3D ) AECC POINTS to C3D points  (Read 5970 times)

0 Members and 1 Guest are viewing this topic.

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
( C3D ) AECC POINTS to C3D points
« on: August 18, 2005, 07:52:28 AM »
Anyone know of a way to convert AECC points to point groups (c3d) from within the dwg?
TheSwamp.org  (serving the CAD community since 2003)

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
( C3D ) AECC POINTS to C3D points
« Reply #1 on: August 18, 2005, 11:17:41 AM »
export all aecc points to a PNEDELEV format and import into civil3d

mstg007
Civil3D 2020

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
( C3D ) AECC POINTS to C3D points
« Reply #2 on: August 18, 2005, 12:07:03 PM »
Quote from: MSTG007
export all aecc points to a PNEDELEV format and import into civil3d

No can do!!

TheSwamp.org  (serving the CAD community since 2003)

Dinosaur

  • Guest
( C3D ) AECC POINTS to C3D points
« Reply #3 on: August 18, 2005, 12:16:03 PM »
Are your points Civil 3D points or are they in LDD?  They are different animals.  If they are in C3D format, you can just create a point group and include the points you want to populate it with in the definition.  If they are LDT points, they must be exported from the source into a file and imported into C3D.  If they were existing in a LDT drawing that you just opened in C3D, their is a download just available to convert them into C3D point objects (ONLY for r2006, sorry, I don't have the link).

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
( C3D ) AECC POINTS to C3D points
« Reply #4 on: August 18, 2005, 12:23:00 PM »
Here's a quick-n-dirty way of doing it.
Code: [Select]

(defun c:aecc2csv ( /
                    ; local functions
                    GetFileName XY2NE
                    ; local vars
                    cntr fo aecc_ss ent kwd
                    )

  ;;; *** warning do not use this if you have changed the north
  ;;; *** rotation
  ;;; convert all AECC_POINTS that are inserted in the current
  ;;; dwg to a comma deleimited ascii file with a format of
  ;;; PN,N,E,Z,DESC.
  ;;;
  ;;; you are given the option of removing the points once the
  ;;; file has been created.
  ;;;
  ;;; Copyright© 2005 Mark S. Thomas
  ;;; Mark S. Thomas ( mark@theswamp.org )

  (setq cntr 0)

  (defun GetFileName ( / file2open)
    (setq file2open
          (getfiled
            "Select text file to open"
            "c:\\temp\\" ; **you might want to change this**
            "txt"
            1
            )
          )
    )

  ;; convert a point list to comma delimited string
  ;; Y before X
  (defun XY2NE (lst)
    (strcat
      (rtos (cadr lst))
      ","
      (rtos (car lst))
      )
    )

  (if (setq fn (GetFileName))
    (setq fo (open fn "w"))
    (exit)
    )

  (if (setq aecc_ss (ssget "X" '((0 . "AECC_POINT"))))
    (while (setq ent (ssname aecc_ss cntr))
           (write-line
             (strcat
               (itoa (cdr (assoc 90 (entget ent)))) ; point number
               ","
               (XY2NE (cdr (assoc 11 (entget ent))))
               ","
               (rtos (car (reverse (assoc 11 (entget ent))))) ; elev
               ","
               (cdr (assoc 303 (entget ent))) ; description
               )
             fo
             )
           (setq cntr (1+ cntr))
           )
    )

  (close fo)

  (princ)

  (initget "Yes No")
  (setq kwd (getkword "\nDelete AECC Points [Yes/No]: "))
  (cond ((= kwd "Yes")
         (setq cntr 0)
         (while (setq ent (ssname aecc_ss cntr))
                (entdel ent)
                (setq cntr (1+ cntr))
                )
         (princ (strcat "\n"(itoa (sslength aecc_ss)) " points removed"))
         )
        (T (princ))
        )

  (princ)
  )



** changed from DXF code 10 to 11 ***
TheSwamp.org  (serving the CAD community since 2003)

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
( C3D ) AECC POINTS to C3D points
« Reply #5 on: August 18, 2005, 12:55:29 PM »
WARNING! Mark, While that code will probably usually do what you want, there are problems with it. If your drawing has any BasePoint/NorthRotation applied, this won't get that. Second, if any point text has been moved away from the point marker your code gets the text location....not the point location.

The AECC_POINT object has 2 group 10 lists. The first is for the text location in the drawing. The second one holds the XYZ for the point. The group 11 list holds the ENZ, this is the one you should be using in your export.

HTH,
Jeff

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
( C3D ) AECC POINTS to C3D points
« Reply #6 on: August 18, 2005, 01:11:07 PM »
Thanks Jeff. I knew about the dxf code 11 just didn't think about. Must be the headache I've had to 26 hours now.
TheSwamp.org  (serving the CAD community since 2003)