.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Update Dynamic Block Visibility States and Values Using VB.NET

5 REPLIES 5
Reply
Message 1 of 6
rpearsall
2355 Views, 5 Replies

Update Dynamic Block Visibility States and Values Using VB.NET

Hi,

 

I want to be able to update a dynamic block with data from our SQL Server database using a VB.NET program.

 

The dynamic block is configured to show office locations and has the associated office addresses for each office location embedded within the block.  However, over time, offices close, new offices are added, addresses change, and so on.  Plus, we have a dynamic block in each sheet size for several template types.  So, updating them remotely would be a huge advantage.  I'd like to just click a button, and know that the offices in the blocks were up to date and accurate.

 

Currently, I can use VLISP and the DBX technology to open each file and change the addresses.  But, I cannot figure out how to change the visibility state (office name) in the prompt list.  Anyhow, I want to drive the changes from a VB external application rather than having to open AutoCAD and run a LISP routine.  So...

 

Does anyone know how to modify the following properties of a dynamic block using VB.NET?

 

1. The visibility states prompt list. (add, delete, modify)

2. The associated values. (add, delete, modify)

 

Thanks,

 

Randy

5 REPLIES 5
Message 2 of 6
fenton.webb
in reply to: rpearsall

have you tried acedCmd() or sendStringToExecute to pump the command instructions to the commandline?




Fenton Webb
AutoCAD Engineering
Autodesk

Message 3 of 6
rpearsall
in reply to: fenton.webb

No.  I am not familiar with those commands.  I tried executing them on the command line and in the VLIDE editor.  Neither worked.  Apropos does not recognize them.  What library do the belong to?  Are they instantiated through a referenced DLL in VB?

 

Randy

Message 4 of 6
Balaji_Ram
in reply to: rpearsall

Sorry for the delay in getting back to you.

 

My colleague, Fenton Webb is out-of-office for this week.

 

Regarding your query :

 

The dynamic blocks is one area which has very limited API access.The COM API is even more restrictive in this area.

 Unfortunately, it does not seem possible to do what you want through API.



Balaji
Developer Technical Services
Autodesk Developer Network

Message 5 of 6
gjolin
in reply to: Balaji_Ram

Been QUITE SOME TIME since this question was last addressed.  I'm wondering if it is now possible to access a dynamic block reference and change the visibility state programmatically.   

Same as the original question, I'd like to be able to update the address of different divisions within my company with the click of a button (i'm using a windows form application and C#).

 

Thanks,

Capture.PNG

Message 6 of 6
norman.yuan
in reply to: gjolin

Your question and the old discussion thread revived by your post are actually quite different issues: the original discussion is about updating block definition's dynamic  properties (i.e. updating the dynamic property designs in block definition), in which case, things have not changed: no API available to do that; your question, on the other hand, is change dynamic block reference property value in a block reference, in which case, again things also have not changed since, and yes, you can change it via code, either with .NET API or COM API.

 

In your case, as the picture shows, you have Visibility state set as dynamic property "Visibility1" (its name), and it may have a list of states, names like "DV 50", "DV 100", "DV xxx"..., you can use code to set this property ("Visibility1") to any of the state names in the state list according to your need.  

 

Since you are using Windows form application (an exe app), you need to use COM API to connect to AutoCAD, find the target block reference and set its "Visibility1" dynamic property You can use AutoCAD's VBA's Object Browser to find out how to access AcadDynamicBlockReferenceProperty in an AcadBlockReference.

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost