tpm_traceelemid

AutoCAD Map 3D AutoLISP

Up a level
tpm_traceelemid
 
 

Returns the ID of the selected element.

(tpm_traceelemid trace_id type index)

Returns an element ID (real) or nil.

trace_id Tracing model ID (real) returned by tpm_tracealloc
type Element type:
1 Node
2 Link
index Element index. The first element's index is 0

This function returns the ID of the element selected. Use this function to find the trace result in the source topology after performing a trace with tpm_traceshort or tpm_traceflood.

This example performs a short path trace and gets the ID of the first link of the result path.

; open topology to trace
(setq tpm_id (tpm_acopen "nettopo" nil))
; create the model
(setq trc_id (tpm_tracealloc tpm_id))
; find shortest path
(tpm_traceshort trc_id start_id end_id)
; number of links in path
(setq qty (tpm_traceqty trc_id 2))
; get first link of path
(setq id (tpm_traceelemid trc_id 2 0))