|
Tutorials
|
|
This peace of code may seem like the insert block code however there are some usefull features in this peace. With this function you are able to ask users input for Block Insertion point and Rotation angle. To test this sample create a block called BLOCK and save it to your C:\ drive.
Show/Hidden vbnet codeSub test()
'Sub to test the function
Insertblock "C:\block.dwg"
End Sub
Function Insertblock(ByVal blockname As String)
Dim pnt, pnt2 As Variant
prompt1 = vbCrLf & "Enter block insert point: "
'Get the first point without entering a base point
pnt = ThisDrawing.Utility.GetPoint(, prompt1)
'Insert the block
Set blockRefObj = ThisDrawing.ModelSpace.Insertblock(pnt, blockname, 1#, 1#, 1#, 0)
On Error Resume Next
'Specify rotation angle on screen
blockRefObj.Rotate pnt, ThisDrawing.Utility.GetAngle(pnt, "Select Rotation Angle:")
End Function
Attachments:
| File | Description | File size | Downloads |
Blockinput.dvb | Insert Block using Users Input | 14 Kb | 289 |
|