I wanted to answer this question, because it has been asked before, but without an resolution.
I couldn't find much information on it so I asked Lee Ambrosius. Below is what he had to say. Thanks @ambrosl
There is some basic documentation in the ObjectARX Developer’s Guide. It explains the dictionary and how it has a pointer to the actual AcDbAssocNetwork object. The objects are spread across several places though in the drawing itself. (The user variable is stored in a dictionary of this network.)
What you are trying to do isn’t possible with VBA directly as there are no classes exposed at that level. Now you could export the drawing to DXF and parse it for the information you are looking for which could take time based on the size of the drawing file.
You can use AutoLISP to pull the data, write it to a file or dictionary and then read that with VBA to get the current values. Modifying the data would be the reverse, basically push it back to a data file or dictionary that AutoLISP would process. The data isn’t easy to work with though as you will see in the example below it is nested pretty deep but here is some basic code that will locate the dimension and user defined parameter variables and their values.
Managed .NET is the best language to use for this.
Below is a sample lisp of how to do this.
(setq assocNetDict (assoc 350 (entget (namedobjdict))))
(setq assocNet
(entget
(cdr
(assoc
330
(reverse
(entget
(cdr
(assoc 350
(entget
(cdr assocNetDict)
)
)
)
)
)
)
)
)
)
(setq lookUpItems nil)
(foreach item assocNet
(if (= (car item) 100)
(if (= (cdr item) "AcDbAssocNetwork")
(setq lookUpItems T)
)
)
(if (and (= (car item) 360)(= lookUpItems T))
(progn
(princ (entget (cdr item)))
)
)
)
((-1 . <Entity name: 220986f46d0>) (0 . ACDBASSOCVARIABLE) (5 . 275) (102 . {ACAD_REACTORS) (330 . <Entity name: 220986f46e0>) (102 . }) (330 . <Entity name: 220986f4670>) (100 . AcDbAssocAction) (90 . 2) (90 . 0) (330 . <Entity name: 220986f4670>) (360 . <Entity name: 0>) (90 . 1) (90 . 0) (90 . 0) (90 . 0) (90 . 0) (90 . 0) (90 . 0) (100 . AcDbAssocVariable) (90 . 2) (1 . d1) (1 . 13.2902766714) (1 . AcDbCalc:1.0) (1 . ) (40 . 13.2903) (290 . 0) (290 . 0) (90 . 0))
((-1 . <Entity name: 220986f4710>) (0 . ACDBASSOC2DCONSTRAINTGROUP) (330 . <Entity name: 220986f4670>) (5 . 279) (100 . AcDbAssocAction) (90 . 2) (90 . 0) (330 . <Entity name: 220986f4670>) (360 . <Entity name: 0>) (90 . 2) (90 . 3) (90 . 0) (90 . 0) (90 . 0) (90 . 0) (90 . 0) (90 . 2) (70 . 0) (10 0.0 0.0 0.0) (10 1.0 0.0 0.0) (10 0.0 1.0 0.0) (360 . <Entity name: 0>) (90 . 3) (360 . <Entity name: 220986f4720>) (360 . <Entity name: 220986f46f0>) (360 . <Entity name: 220986f46e0>) (90 . 6) (90 . 0) (90 . 0) (290 . 0) (90 . 6) (1 . AcConstrainedBoundedLine) (90 . 1) (1 . AcConstrainedImplicitPoint) (90 . 2) (1 . AcPointCurveConstraint) (90 . 3) (1 . AcConstrainedImplicitPoint) (90 . 4) (1 . AcPointCurveConstraint) (90 . 5) (1 . AcDistanceConstraint) (90 . 6) (90 . 1) (90 . 2) (90 . 3) (90 . 5) (70 . 1) (330 . <Entity name: 220986f4720>) (90 . 0) (10 18.511 8.74125 0.0) (10 0.833581 0.552398 0.0) (290 . 0) (10 18.511 8.74125 0.0) (11 29.5895 16.0828 0.0) (90 . 2) (90 . 2) (90 . 3) (90 . 6) (70 . 1) (330 . <Entity name: 0>) (90 . 0) (280 . 0) (90 . -1) (90 . 1) (90 . 3) (90 . 2) (90 . 2) (90 . 1) (70 . 0) (90 . 0) (290 . 1) (290 . 1) (90 . 4) (90 . 2) (90 . 5) (90 . 6) (70 . 1) (330 . <Entity name: 0>) (90 . 0) (280 . 1) (90 . -1) (90 . 1) (90 . 5) (90 . 2) (90 . 4) (90 . 1) (70 . 0) (90 . 0) (290 . 1) (290 . 1) (90 . 6) (90 . 2) (90 . 2) (90 . 4) (70 . 0) (90 . 0) (290 . 0) (290 . 1) (340 . <Entity name: 220986f46e0>) (340 . <Entity name: 220986f46f0>) (280 . 0))
((-1 . <Entity name: 220986f4730>) (0 . ACDBASSOCVARIABLE) (330 . <Entity name: 220986f4670>) (5 . 27B) (100 . AcDbAssocAction) (90 . 2) (90 . 0) (330 . <Entity name: 220986f4670>) (360 . <Entity name: 0>) (90 . 3) (90 . 0) (90 . 0) (90 . 0) (90 . 0) (90 . 0) (90 . 0) (100 . AcDbAssocVariable) (90 . 2) (1 . U1) (1 . 2.5) (1 . AcDbCalc:1.0) (1 . ) (40 . 2.5) (290 . 0) (290 . 0) (90 . 0))
Ed
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to
post your code.