我显然会先和他们谈谈这件事;如果他们公然蔑视标准,我想我会进入下一步。
幸运和不幸的是,我在这里没有那种权威。
一些公司对标准过于宽松,可能有点胆小,不敢坚持要求人们遵守。
我想那些公司需要在他们的猕猴桃上多一点模糊。
鲍勃,
我正在看你的代码
sub unloadify(strMacro as string)
Dim PauseTime, Start
PauseTime = 1
Start = Timer
Do While Timer < Start + PauseTime
Loop'The pause so you give time for the macro to finish before trying to unload
thisdrawing.sendcommand "vbaunload" "Projectname.dvb"
如果我错了,请纠正我。
现在,这是一个单独的子例程,对吗
此外,该行是否应显示sub unload(项目名称为字符串)
谢谢
马克
鲍勃:我以前说过,现在我再说一遍;
你是最棒的!
我认为您在sendcommand中漏掉了几个输入,但我得到了它代码4]
以下是结果:
Sub BlockonlayersLoop() 'This Sub will keep prompting for the next block until user escapes.
Dim B As AcadBlock
Dim ent As AcadEntity
Dim P
Dim LayerCol As New Collection
Dim slayer As String
Dim Picked As Boolean
Dim i As Integer
Dim PauseTime, Start 'Bob's Code
PauseTime = 1 'Bob's Code
Start = Timer 'Bob's Code
Do While Timer < Start + PauseTime 'This pause gives time for the macro to finish before trying to unload 'Bob's Code
Do
On Error Resume Next
ThisDrawing.Utility.GetEntity ent, P, "Pick a blockref"
If Not TypeOf ent Is AcadBlockReference Then
Picked = False
GoTo ExitOut
Else
Picked = True
End If
If ent Is Nothing Then
Picked = False
GoTo ExitOut
Else
Picked = True
End If
Set B = ThisDrawing.Blocks(ent.Name)
Debug.Print "The block " & B.Name & " uses the following layers:"
For Each ent In B
slayer = ent.Layer
For i = 1 To LayerCol.Count
If LayerCol(i) = slayer Then GoTo Skip
Next
LayerCol.Add slayer
Skip:
Next
For i = 1 To LayerCol.Count
Debug.Print LayerCol(i)
Next
ExitOut:
Dim Num As Integer
For Num = 1 To LayerCol.Count
LayerCol.Remove 1
Next
Loop Until Picked = False
Loop
ThisDrawing.SendCommand "vbaunload" & vbCr & "Tools.dvb" & vbCr 'Bob's Code
End Sub
它看起来非常有效
谢谢您,先生!
我实际上是建议你做一个lisp等价的sub来卸载它,只是为了更接近你所尝试的,我只是没有时间去弄清楚如何将信息传递给lisp或者如何暂停一段特定的时间。很高兴你满意了。
我明白了
不幸的是我不太擅长LISP
LISP例程是CM传给我的。
这是一个很好的程序,我只是不知道如何按照你建议的方式编辑它。
“如果”你有时间,我当然希望看到它
这种方法也很好,不是吗?
标记
页:
1
[2]