PDA

View Full Version : Invisible Block



wpeacock
2005-01-31, 12:45 AM
I'm using the following code to insert a block into a drawing.

Once the code has finished there appears to be no block.
Zoom > Extents ....No Block

However using "bcount" AutoCAD counts the block and returns
"J102622......1" to the command line.

How can I make the block visible?

Regards

Wayne




Private Sub CommandButton1_Click()
'create the block
Dim J102622 As AcadBlock
Dim J102622Pnt(0 To 2) As Double
Dim J102622PathName As String 'describe thew path name of the block
J102622Pnt(0) = 0: J102622Pnt(1) = 0: J102622Pnt(2) = 38 'blocks xyz insertion points
J102622PathName = "C:\Temp\102622xyz.dwg" 'path of block

' Add the external reference to the block
Set J102622 = ThisDrawing.Blocks.Add(J102622Pnt, "J102622")

' Insert the block
Dim blockRefObj As AcadBlockReference
Set blockRefObj = ThisDrawing.ModelSpace.InsertBlock(J102622Pnt, "J102622", 1#, 1#, 1#, 0)
blockRefObj.Update
ZoomAll

End Sub

ntaylor
2005-01-31, 05:58 AM
Private Sub CommandButton1_Click()
Dim J102622Pnt(0 To 2) As Double
Dim J102622PathName As String 'describe thew path name of the block
J102622Pnt(0) = 0: J102622Pnt(1) = 0: J102622Pnt(2) = 38 'blocks xyz insertion points
J102622PathName = "C:\Temp\102622xyz.dwg" 'path of block

' Insert the block
Dim blockRefObj As AcadBlockReference
Set blockRefObj = ThisDrawing.ModelSpace.InsertBlock(J102622Pnt, J102622PathName, 1#, 1#, 1#, 0)
blockRefObj.Update
ZoomAll

End Sub

wpeacock
2005-01-31, 06:44 AM
Many thanks ntaylor!!!

I've been scratching my head over this one for weeks...
If I ever get over to SA it's my shout!

Thanks

Wayne

hnewman
2006-07-12, 09:06 PM
Use quick select from properties, then change the visiblity state if it is dynamic. If isn't, erase and re-insert. I have had the same problems with blocks, some one inserts them, then erase, but there is still a reference found. the quick select is the funnel looking button the properties palette