Message 1 of 9
Insert block whilst displaying it
Not applicable
02-26-2008
03:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have searched the NGs and this is partially answered in many posts but I
can't seem to find a solution.
I want to pause for user input whilst inserting a block as I want the user
to be able to provide the insertion point and possibly change the rotation
angle (which I achieved with "r 90" etc selected from a menu) and of course
trap that the user may Escape etc. I iterate through many blocks doing this
then programmatically update attributes using .
I had this all working great with the following code but it crashes when
using the mouse to pan:-
GetPoint:
ThisDrawing.SendCommand "-Insert" & vbCr & blockName & vbCr & "R" & vbCr
& Rotation & vbCr & "S" & vbCr & "1" & vbCr
If InStr(ThisDrawing.GetVariable("LASTPROMPT"), "*Cancel*") > 0 Then
Exit Function
If InStr(ThisDrawing.GetVariable("LASTPROMPT"), "Command:") > 0 Then
Exit Function
If InStr(ThisDrawing.GetVariable("LASTPROMPT"),
"[Basepoint/Scale/X/Y/Z/Rotate]:") > 0 Then GoTo SetBlock
'any other response reissue command
GoTo GetPoint
SetBlock:
Set oBlockRef =
ThisDrawing.ModelSpace.Item(ThisDrawing.ModelSpace.Count - 1)
Rotation = oBlockRef.Rotation
........
Why this is happening has been explained so I want to find the next best
solution, preferably without resorting to DLLs, ObjectARX, .Net etc. I have
seen suggestions with lisp including the following:-
(command "-insert" block pause "" "")
But if I issue a sendcommand with the above it continues processing the code
that follows. Is there a VBA / lisp solution?
Many thanks in anticipation
Dave Preston
can't seem to find a solution.
I want to pause for user input whilst inserting a block as I want the user
to be able to provide the insertion point and possibly change the rotation
angle (which I achieved with "r 90" etc selected from a menu) and of course
trap that the user may Escape etc. I iterate through many blocks doing this
then programmatically update attributes using .
I had this all working great with the following code but it crashes when
using the mouse to pan:-
GetPoint:
ThisDrawing.SendCommand "-Insert" & vbCr & blockName & vbCr & "R" & vbCr
& Rotation & vbCr & "S" & vbCr & "1" & vbCr
If InStr(ThisDrawing.GetVariable("LASTPROMPT"), "*Cancel*") > 0 Then
Exit Function
If InStr(ThisDrawing.GetVariable("LASTPROMPT"), "Command:") > 0 Then
Exit Function
If InStr(ThisDrawing.GetVariable("LASTPROMPT"),
"[Basepoint/Scale/X/Y/Z/Rotate]:") > 0 Then GoTo SetBlock
'any other response reissue command
GoTo GetPoint
SetBlock:
Set oBlockRef =
ThisDrawing.ModelSpace.Item(ThisDrawing.ModelSpace.Count - 1)
Rotation = oBlockRef.Rotation
........
Why this is happening has been explained so I want to find the next best
solution, preferably without resorting to DLLs, ObjectARX, .Net etc. I have
seen suggestions with lisp including the following:-
(command "-insert" block pause "" "")
But if I issue a sendcommand with the above it continues processing the code
that follows. Is there a VBA / lisp solution?
Many thanks in anticipation
Dave Preston