|
发表于 2022-7-6 23:16:54
|
显示全部楼层
I'm getting there
Im sorry for being a VBA dummy ....but I have one more obstacle.
As it might be simpler to use the sendcommand, i just need help to write it.
I am not a coder by any means....so excuse my lack of knowledge
This code below will place the block in the drawing....great. But it places it (from user point selection), square on the drawing. I want to be able to insert the block and select the direction of the block (rotate) . Most of the time it will be in 90º selections (place on drawing and go either up, down, left or right). I am guessing the sendcommand line will go after the second last line
I can't get this rotation working at all.....sigh
can anyone help with this lillte snippet here??
Private Sub cmdProfileinsert_Click()
Dim strPath As String
Dim strBlockName As String
Dim objBlock As AcadBlock
Dim entRef As AcadBlockReference
Dim dblPkPt() As Double
strBlockName = "Profile"
strPath = "H:\blah\blah\Profile.dwg"
On Error Resume Next
Set objBlock = ThisDrawing.Blocks.Item(strBlockName)
On Error GoTo 0
If Not objBlock Is Nothing Then objBlock.Delete 'To reinitialize Block from container file
DbxCopyBlock strBlockName, strPath 'Copy block into ThisDrawing
dblPkPt = ThisDrawing.Utility.GetPoint(, "Pick insertion Point: ") 'Get insertion point for test insert
Set entRef = ThisDrawing.ModelSpace.InsertBlock(dblPkPt, "Profile", 1#, 1#, 1#, 0) 'Test insert
End Sub |
|