在開發過程中難免要進行大量測試,需要查看某些物件的屬性和值,比如查看net有哪些屬性,每個屬性的值是什麼,如果還需要每次手動輸入代碼,那就太慢了。
下面介紹一種快速查看的方法,只需點一下滑鼠就行了,效果如下:
defun(prop_view ()
prog((obj propList p i mypopup logFile logWindow)
; 定義右鍵功能表
mypopup = axlUIPopupDefine(nil list(
list("Done" "axlUIPopupSet(nil) axlFinishEnterFun()")
list("Cancel" "axlUIPopupSet(nil) axlCancelEnterFun()")
))
axlUIPopupSet(mypopup)
axlClearSelSet()
; 設置篩檢程式
axlSetFindFilter(?enabled '(all) ?onButtons '(VIAS CLINESEGS SHAPES PINS TEXT ))
while(axlSingleSelectPoint() ;等待用戶選擇
i = 0
obj = car(axlGetSelSet())
axlClearSelSet()
propList = obj->??
logFile = axlTempFile()
p = outfile(logFile)
while(i < length(propList)-1
fprintf(p "%L\t" nth(i propList))
fprintf(p "%L\n" nth(i+1 propList))
i = i+2
)
close(p)
if(logWindow then ;加判斷是為了只打開一個日誌視窗
axlUIViewFileReuse(logWindow logFile "Report Object Properties" t) else
logWindow = axlUIViewFileCreate(logFile "Report Object Properties" t)
)
)
))
文章標籤
全站熱搜
