Message 1 of 7
tpm_elemadj
Not applicable
07-20-2007
02:35 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
I am working on learning the topology functions and I can not get the tpm_elemadj function to work. I am using global variables for topo_id and cent_id and these print out correctly from the princ statements. but the lst and final princ statements print nil. The code follows:
;A fair amount of this code came from Rackesh at www.4d-technologies.com
;David Van Eman
(defun C:rect (/ cent_id lst TopoName topo_id)
(setq TopoName (getstring "Enter Topology name."))
(setq
Exists nil
lst '()
)
(if (setq Exists (tpm_acexist TopoName T nil))
(setq LoadedNow (tpm_acload TopoName))
)
(if Exists
(progn
(setq topo_id (tpm_acopen TopoName nil))
(Centid)
(princ (strcat "\nrect cent_id: " (rtos cent_id 2 0) "\n"))
(Adj)
(princ "\nPast Adj function")
(tpm_acclose topo_Id)
)
(if LoadedNow
(tpm_acunload TopoName)
)
)
(princ)
)
(defun Centid (/ cell ss cnt pt)
(if topo_id
(progn
(setq cell (getstring "Enter Cell number: "))
(setq ss (ssget "x" (list '(0 . "TEXT") (cons 1 cell))))
(setq cnt 0)
(if ss
(repeat (sslength ss)
(setq pt (cdr (assoc 10 (entget (ssname ss cnt)))))
)
)
(setq cent_id (tpm_elemfind topo_id 3 pt))
(princ (strcat "\nCentid cent_id: " (rtos cent_id 2 0) "\n"))
(setq ss nil)
)
)
(princ)
)
(defun Adj (/ final)
(princ "\n\nIn Adj")
(princ (strcat "\nTopo ID: " (rtos topo_id 2 0)))
(princ (strcat "\nCentroid ID: " (rtos cent_id 2 0)))
(setq lst (tpm_elemadj topo_id cent_id 1)) ;HERE IS THE PROBLEM
(setq final (vl-prin1-to-string lst))
(princ lst)
(princ final)
(princ "\nAdj done\n")
)
Thanks to anyone who takes a look at this.
Dave
I am working on learning the topology functions and I can not get the tpm_elemadj function to work. I am using global variables for topo_id and cent_id and these print out correctly from the princ statements. but the lst and final princ statements print nil. The code follows:
;A fair amount of this code came from Rackesh at www.4d-technologies.com
;David Van Eman
(defun C:rect (/ cent_id lst TopoName topo_id)
(setq TopoName (getstring "Enter Topology name."))
(setq
Exists nil
lst '()
)
(if (setq Exists (tpm_acexist TopoName T nil))
(setq LoadedNow (tpm_acload TopoName))
)
(if Exists
(progn
(setq topo_id (tpm_acopen TopoName nil))
(Centid)
(princ (strcat "\nrect cent_id: " (rtos cent_id 2 0) "\n"))
(Adj)
(princ "\nPast Adj function")
(tpm_acclose topo_Id)
)
(if LoadedNow
(tpm_acunload TopoName)
)
)
(princ)
)
(defun Centid (/ cell ss cnt pt)
(if topo_id
(progn
(setq cell (getstring "Enter Cell number: "))
(setq ss (ssget "x" (list '(0 . "TEXT") (cons 1 cell))))
(setq cnt 0)
(if ss
(repeat (sslength ss)
(setq pt (cdr (assoc 10 (entget (ssname ss cnt)))))
)
)
(setq cent_id (tpm_elemfind topo_id 3 pt))
(princ (strcat "\nCentid cent_id: " (rtos cent_id 2 0) "\n"))
(setq ss nil)
)
)
(princ)
)
(defun Adj (/ final)
(princ "\n\nIn Adj")
(princ (strcat "\nTopo ID: " (rtos topo_id 2 0)))
(princ (strcat "\nCentroid ID: " (rtos cent_id 2 0)))
(setq lst (tpm_elemadj topo_id cent_id 1)) ;HERE IS THE PROBLEM
(setq final (vl-prin1-to-string lst))
(princ lst)
(princ final)
(princ "\nAdj done\n")
)
Thanks to anyone who takes a look at this.
Dave