Announcement

Collapse
No announcement yet.

Dispalying Datapoints from Mulitple Layers

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dispalying Datapoints from Mulitple Layers

    Hi. I'm completely new to AutoLisp, but I have a little VBA experience. I use this code all the time, but don't know how it works exactly. The AutoCAD file is opened through a record (circuit) in a program called Ultra-Pipe. There are some commands that only work when opened through Ultra-Pipe. Someone in the past, I dont know who, created the code below to work with that program and display all datapoints with the layer that ends with "-DATA". If there was more than one circuit attached to the AutoCAD drawing, the data layer that would have all of the datapoints displayed corresponded to the circuit through which the AutoCAD file was opened.

    Well the company that made Ultra-Pipe upgraded to a new software called PS AIM and the circuits have been transferred, but the command doesn't work exactly the same way it used to. Now, if there is more than one circuit attached, it olny displays the datapoints from one circuit regardless of which circuit you opened the drawing from. I figure if I can get the code posted below to apply to ALL layers ending with "-DATA" my problems might be solved.

    Anyone want to take a crack at it?

    I have also attached a screenshot of the layers in question if that helps.

    Thanks in advance.


    Code:
    (defun c:UD1 (/ pl dl pt1 inputline nLp linetext)
    (setvar "cmdecho" 0)
    (setq pl (getvar "clayer")
    dl (strcat switchto "-data")
    )
    (command "_.layer" "c" "152" dl "s" dl ""
    "_.style" "h" "qual.shx" "0.1" "0.85" "" "" "" ""
    )
    (setq pt1 (getpoint "\n \n \nPick start point for text: "))
    (if pt1
    (progn
    (setq inputline " ")
    (openfile)
    (seek-tcircuit)
    (while (/= inputline "DATAPOINTS")
    (setq inputline (read-line infile))
    )
    (setq inputline (read-line infile))
    (if (/= inputline "END DATAPOINTS")
    (progn
    (command "_.text" pt1 0.1 0 (getline 1 inputline))
    ; (setq nLp 2)
    ; (while (<= nLp 5)
    ; (setq LineText (getline nLp inputline))
    ; (if (/= LineText " ")
    ; (command "_.text" "" Linetext
    ; "_.change" "L" "" "P" "LA" DPINFO ""
    ; )
    ; )
    ; (setq nLp (1+ nLp))
    ; )
    (setq inputline (read-line infile))
    (while (/= inputline "END DATAPOINTS")
    (command "_.text" "" (getline 1 inputline))
    ; (setq nLp 2)
    ; (while (<= nLp 5)
    ; (setq LineText (getline nLp inputline))
    ; (if (/= LineText " ")
    ; (command "_.text" "" Linetext
    ; "_.change" "L" "" "P" "LA" DPINFO ""
    ; )
    ; )
    ; (setq nLp (1+ nLp))
    ; )
    (setq inputline (read-line infile))
    )
    (closefile)
    (c:update)
    )
    )
    )
    )
    (setvar "clayer" pl)
    (princ)
    )
    Attached Files
Working...
X