bograd Posted March 20, 2009 Posted March 20, 2009 I am a noob regarding AutoLisp. What i want to do is this : I have drawing where i need to number many blocks. So i use DTEXT and place it near each block and type the number. Is there a way to automate this procedure ? I want to start a command, place the point of insert for the first block, type the first number, and then just point the next block and it should increment the previous number and place it. Does this make any sense ? Quote
lpseifert Posted March 20, 2009 Posted March 20, 2009 From the very generous ASMI http://www.asmitools.com/Files/Programs.html Quote
bograd Posted March 20, 2009 Author Posted March 20, 2009 Awesome, works like a charm. Thanks ASMI. Now to be very picky, is there a way to auto number using DTEXT instead of attributed blocks ? Quote
Lee Mac Posted March 20, 2009 Posted March 20, 2009 ASMI's code numbers it using DTEXT... http://www.asmitools.com/Files/Lisps/Num.html Quote
bograd Posted March 20, 2009 Author Posted March 20, 2009 I am blind . I just saw it now. Thank you all. Quote
Lee Mac Posted March 20, 2009 Posted March 20, 2009 Maybe see here also: http://www.cadtutor.net/forum/showthread.php?t=34034 Quote
bograd Posted January 28, 2010 Author Posted January 28, 2010 The asmitools link doesn't work. Does anybody have a valid link? Thanks. LE: found it. Quote
Lee Mac Posted January 28, 2010 Posted January 28, 2010 These may help: http://www.cadtutor.net/forum/showthread.php?t=35234 http://www.cadtutor.net/forum/showthread.php?t=37420 Quote
giskumar Posted January 29, 2010 Posted January 29, 2010 Hi, Here is a small code in vba. I think it may help you. Public num As Integer Private Sub AcadDocument_BeginCommand(ByVal CommandName As String) If CommandName = "DTEXT" Then If num = 0 Then num = InputBox("Please Enter Starting number") End If Dim txt As AcadText Dim po As Variant po = ThisDrawing.Utility.GetPoint(, "Select Insertion point") Set txt = ThisDrawing.ModelSpace.AddText(CStr(num), po, 1) num = num + 1 End If End Sub This will generate the increment number while continuos use of DTEXT command. After using of any other command you have to set the starting number. Have a good day... KUMAR..... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.