Home AutoCad VB Insert Block using Users Input
20 | 05 | 2012
This site has been updated and renewed. You have followed an old link.

Click here to go to the new site

http://www.visiblevisual.com/jupgrade

Insert Block using Users Input PDF Print E-mail
User Rating: / 0
PoorBest 
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 code

View source
Sub 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:
FileDescriptionFile sizeDownloads
Download this file (Blockinput.dvb)Blockinput.dvbInsert Block using Users Input14 Kb289
 

Add comment


Security code
Refresh

This site has been updated and renewed. You have followed an old link.

Click here to go to the new site

http://www.visiblevisual.com/jupgrade