Jump to content

VBA Add New Rows to Lookup Parameter - DynamicBlock


Recommended Posts

Posted

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

 

 

DYN-Foam3.gif

 

(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:

 

 

DYN-Foam4.gif

 

 

 

Suggestions?

 

Thanks

Posted

Has nobody used VBA with Dynamic Blocks??

Posted

Can anyone at lease point me in the right direction?

Posted

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.

Posted

Here

I will send to the author the e-mail with the request to adapt lisp for English

  • 3 years later...
Posted

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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...