LSP path auto attribute routine needed

Discussion in 'AutoCAD' started by WorldWind, Oct 15, 2004.

  1. WorldWind

    WorldWind Guest

    I am looking for a LSP routine that will auto insert and provide auto updating of a title block attribute field containing the path and drawing name of the dwg.
     
    WorldWind, Oct 15, 2004
    #1
  2. Need an atibuted block called PATH, rotated at 90º.

    Try:

    ;;; Lisp para trocar path do Formato
    ;;; Desenvolvida por: Edivan de Lira
    ;;; Data: 31/08/04
    ;;; Comando inicial: PT

    (defun c:pT (/ atributo caminho ename ent ss)
    (setvar "cmdecho" 0)
    (command "view" "save" "VS")
    ;(if (tblsearch "block" "path")(command "purge" "block" "path" "n"))
    (if (not (tblsearch "block" "path"))(command "insert" "path" "0,0" "" "" ""))
    (setq ss (ssget "x" (list (cons 0 "INSERT") (cons 2 "PATH"))))
    (if ss
    (progn
    (setq ename (ssname ss 0))
    (setq ent (entget ename))

    (setq atributo (cdr (assoc 2 ent)))
    (setq insert(cdr (assoc 10 ent)))
    (if (= atributo "PATH")
    (progn
    (setq ename (entnext ename))
    (setq ent (entget ename))
    (setq caminho (strcat (getvar "dwgprefix") (getvar "dwgname")))
    (entmod (subst (cons 1 caminho) (assoc 1 ent) ent))
    (entupd ename)
    (command "zoom" "window" insert "@50,50" )
    (princ "\n The path -> ")(princ caminho)
    (setq ANSWER1 (getstring "\n Press enter to return to Previous View!"))
    (if (= (strcase ANSWER1) "")(command "view" "restore" "VS"))
    )
    )

    )
    )
    (setvar "cmdecho" 1)
    (princ)
    )

    []´s,

    Rogério
     
    Rogerio_Brazil, Oct 15, 2004
    #2
  3. WorldWind

    WorldWind Guest

    Agradece adivinho... vai ir este pasted de trabalho como está em a meu verson inglês de 2000i
     
    WorldWind, Oct 18, 2004
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.