0
我目前正在爲AutoCAD生成圖形代碼,爲了生成圖形,必須選擇某些選項,並且當選擇了錯誤的選項時,該人員可以點擊返回去糾正這個選項。下面是我的代碼,問題是代碼不會在單擊「返回」時刪除之前選擇的數據,例如,如果我選擇「SBPP」點擊輸入並且需要我選擇「Louvres」選項,則I想回去,並從「SBPP」到「STD管道」,先前選擇「SBPP」改變,必須先擦除:刪除以前選擇的數據
Sub DWG()
Pump: ans = InputBox("1 = STD Piping" & vbCrLf & _
"2 = Omit Pump" & vbCrLf & _
"3 = SBPP", "Pump Piping")
Select Case ans
Case "1":
: Set layerObj = ThisDrawing.Layers.Add("PUMP_PIPING_" & Size)
layerObj.LayerOn = True
Case "2":
: Set layerObj = ThisDrawing.Layers.Add("OMIT_PUMP_" & Size)
layerObj.LayerOn = True
Case "3":
: Set layerObj = ThisDrawing.Layers.Add("STBP_" & Size)
layerObj.LayerOn = True
Case Else: MsgBox "Wrong Input Dude.", vbCritical, MSG: Exit Sub
End Select
'______________________________________________________________________________
'Option for Louvres
Louver: ans = InputBox("1 = STD Louvers" & vbCrLf & _
"2 = IND louvers" & vbCrLf & _
"3 = Back ", "Pump Piping")
Select Case ans
Case "1":
: Set layerObj = ThisDrawing.Layers.Add("LOUVRES_STD")
layerObj.LayerOn = True
Case "2":
: Set layerObj = ThisDrawing.Layers.Add("LOUVRES_INDUS")
layerObj.LayerOn = True
Case "3":
If ans = 3 Then
GoTo Pump
End If
Case Else: MsgBox "Wrong Input Dude.", vbCritical, MSG: Exit Sub
End Select
End Sub
我怎麼能修改此代碼,這樣,當「背」點擊是它以前將清除選擇的數據?
感謝變化@LS_ᴅᴇᴠ但代碼「做之前詢問」還在做着同樣的事情,當選項是在輸入框中選擇的,該圖層是通過圖形打開的,當您點擊後,它不會刪除先前的圖層,而是在其上創建一個不同的圖形並創建一個笨拙的圖形。 – Kwezi
當然它不......那個「撤銷」代碼不是你指定的。讓我檢查 –
在這個 – Kwezi