API提供四种“防假死”(状态栏、命令行、标题行、对话框)进度条
使用“进程监控”技术,防止ACAD长循环过程中“假死” (普通的打印显示进度语句不反应)情况。一、状态栏进度条
(defun C:PROGRESS1 ( / )
(xdrx_ui_prgbar "Command PROGRESS1:" 1000 0.5)
(repeat 1000
(xdrx_ui_prgbar T)
(xdrx_mdelay 10)
)
(xdrx_ui_prgbar)
(princ)
)
二、命令行文字进度条
;;------------------------------------------------
;;Cammand line xdrx_ui_prgbar
;;------------------------------------------------
(defun C:PROGRESS2 ( / )
(xdrx_ui_prgcmdbar "\nCommand PROGRESS2: " 1000 0.5)
(repeat 1000
(xdrx_ui_prgcmdbar T) (princ)
(xdrx_mdelay 10)
)
(xdrx_ui_prgcmdbar)
(princ " Ready!")
(princ)
)
三、左上角标题栏进度条
;;-----------------------------------------------
;;Titlebar xdrx_ui_prgtitlebar
;;-----------------------------------------------
(defun C:PROGRESS3 ( / )
(xdrx_ui_prgtitlebar "Command PROGRESS3: " 1000 0.5)
(repeat 1000
(xdrx_ui_prgtitlebar T)
(xdrx_mdelay 10)
)
(xdrx_ui_prgtitlebar)
(princ)
)
四、非模式对话框进度条 (三种位置:绘图窗口的上、中、下、两种方式:带标题栏和不带标题栏)
三种位置:
(xdrx_ui_prgdlgbar "Command PROGRESS4: " 1000 0.5 "Up")
(xdrx_ui_prgdlgbar "Command PROGRESS4: " 1000 0.5 "Center")
(xdrx_ui_prgdlgbar "Command PROGRESS4: " 1000 0.5 "Down")
带标题栏(位置中间)
(xdrx_ui_prgdlgbar "Command PROGRESS4: " 1000 0.5 "Title")
;;-----------------------------------------------
;;Modeless xdrx_ui_prgdlgbar
;;-----------------------------------------------
(defun C:PROGRESS4 ( / )
(xdrx_ui_prgdlgbar "Command PROGRESS4: " 1000 0.5 "Title")
(repeat 1000
(xdrx_ui_prgdlgbar T)
(xdrx_mdelay 10)
)
(xdrx_ui_prgdlgbar)
(princ)
)
谢谢楼主分享知识 感谢感谢,试试看
谢谢楼主分享知识 用 .net 怎么做这种进度条 <CommandMethod("CADProgressBar")>
Public Sub CADProgressBar()
Dim progressmaxvalue As Integer = 100
Dim progressMeter As ProgressMeter = New ProgressMeter()
progressMeter.Start("正在计算,请稍候...")
progressMeter.SetLimit(progressmaxvalue)
For i As Integer = 0 To progressmaxvalue
System.Threading.Thread.Sleep(5)
progressMeter.MeterProgress()
Next
progressMeter.()
End Sub
页:
[1]