Viper04 Posted March 11, 2009 Posted March 11, 2009 Hello. I'm trying to add values to a DynamicBlock I have. Basically its a box shape with a width & height parameter. I want to add additional rows/values into the LOOKUP parameter inside the DynamicBlock with VBA. See Image (I have specific foam sizes that get updated monthly in my excel file that I will use to update the DYN-Foam DynamicBlock) This is my current code for my button. I can read and add values into a ListBox as long as the parameter doesn't have multiple values ie. lookuptbl1(0).Values(#). I can if its just lookuptbl1(2).Values (which has only 1 number for the Value. How to I add/change any of this content for the LOOKUP Parameter? Private Sub CommandButton4_Click() Dim element As Object Dim lookuptbl As Variant For Each element In ThisDrawing.ModelSpace If element.IsDynamicBlock = True Then lookuptbl = element.GetDynamicBlockProperties lookuptbl(4).Show = False 'The stuff below is for reference only and Displays Fine ListBox1.AddItem pname ListBox2.AddItem lookuptbl(4).PropertyName ListBox2.AddItem lookuptbl(4).Value End If Next End Sub I have removed any setting of values because of errors so I can reveal the watch window ie. lookuptbl(5).Value = "24" or I even tried using the SET SET lookuptbl(5).Show = False My Watch Window: Suggestions? Thanks Quote
Viper04 Posted March 12, 2009 Author Posted March 12, 2009 Has nobody used VBA with Dynamic Blocks?? Quote
Viper04 Posted March 16, 2009 Author Posted March 16, 2009 Can anyone at lease point me in the right direction? Quote
VVA Posted March 16, 2009 Posted March 16, 2009 Programm in lisp from russian forum http://www.dwg.ru: The program of filling Lookup of dynamic properties of the block from the data of table Excel Or in this tread. N.Poleshchuk translate article to English: Mysteries of Autodesk's Caves and You may write to the author by email ( lazebny#pelisker.ru ), changing # to a necessary symbol and putting AutoLISP & AutoCAD in the message topic Quote
Viper04 Posted March 19, 2009 Author Posted March 19, 2009 I don't speak Russian and I and already went thought the super vis states block. I couldn't find the info on the Lookup function that I need. Quote
VVA Posted March 19, 2009 Posted March 19, 2009 Here I will send to the author the e-mail with the request to adapt lisp for English Quote
VVA Posted May 23, 2012 Posted May 23, 2012 at the request of Forum www.dwg.ru slightly adapted lisp Excel-loockup. This includes requests translated into English. How it works: 1. load the lisp 2. Open the block in the Block Editor (BEDIT) 3. Typing commands Excel-Lookup or EL 4. Specify the file excel (xls or xlsx) and a sheet 5. Select target loockup 6. Close the Block Editor Loockup.zip 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.