Renaming Dynamic Block Visibility States using VBA
up vote
0
down vote
favorite
How can I change or rename visibility states for a dynamic block in AutoCAD using VBA, similar to clicking RENAME in the Visibility State dialog box which appears when issuing the BVSTATE command in the Block Editor?
Thanks so much for your help.
vba autocad
add a comment |
up vote
0
down vote
favorite
How can I change or rename visibility states for a dynamic block in AutoCAD using VBA, similar to clicking RENAME in the Visibility State dialog box which appears when issuing the BVSTATE command in the Block Editor?
Thanks so much for your help.
vba autocad
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
How can I change or rename visibility states for a dynamic block in AutoCAD using VBA, similar to clicking RENAME in the Visibility State dialog box which appears when issuing the BVSTATE command in the Block Editor?
Thanks so much for your help.
vba autocad
How can I change or rename visibility states for a dynamic block in AutoCAD using VBA, similar to clicking RENAME in the Visibility State dialog box which appears when issuing the BVSTATE command in the Block Editor?
Thanks so much for your help.
vba autocad
vba autocad
edited Nov 9 at 23:19
Lee Mac
2,47121035
2,47121035
asked Nov 7 at 7:40
Nghia Chau
1
1
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
In short, it is not possible to rename Dynamic Block Visibility States directly using the LISP or VBA API, without resorting to invoking standard AutoCAD commands, for example, using the AutoLISP command function, or sendcommand method.
Dynamic Block Parameters contained within a block definition are not exposed to the ActiveX object model and therefore cannot be modified using Visual LISP or VBA.
Such parameters are exposed to Vanilla AutoLISP by examining the DXF data stored within the Extension Dictionary of the BLOCK_RECORD entity, but such data cannot be modified using entmod, nor does it yield any relevant properties following conversion to an equivalent VLA-Object representation.
For what it's worth, you can access the Dynamic Block Parameter DXF data using the following route through the AutoLISP API:
First, obtain the BLOCK entity:
(setq bl (tblobjname "block" "YourBlockName"))
Then obtain the parent BLOCK_RECORD entity:
(setq br (cdr (assoc 330 (entget bl))))
Now obtain the Extension Dictionary from DXF group 360 (additional checks for the presence of "{ACAD_XDICTIONARY" against DXF group 102 should be used in production code):
(setq d1 (cdr (assoc 360 (entget br))))
Now search this dictionary for the ACAD_ENHANCEDBLOCK entry:
(setq d2 (dictsearch d1 "acad_enhancedblock"))
This will yield the DXF data for the ACAD_EVALUATION_GRAPH entity.
You can then iterate over the DXF group 360 within the DXF data to obtain the DXF data for each Dynamic Block Parameter found within the block definition, e.g.:
_$ (foreach dxf d2 (if (= 360 (car dxf)) (print (cdr (assoc 0 (entget (cdr dxf)))))))
"BLOCKPOLARPARAMETER"
"BLOCKPOLARGRIP"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKPOLARSTRETCHACTION"
"BLOCKFLIPPARAMETER"
"BLOCKFLIPGRIP"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKFLIPACTION"
"BLOCKVISIBILITYPARAMETER"
"BLOCKVISIBILITYGRIP"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKGRIPLOCATIONCOMPONENT"
Thanks for your reply. I'll try to do as your instruction.
– Nghia Chau
Nov 8 at 1:18
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
In short, it is not possible to rename Dynamic Block Visibility States directly using the LISP or VBA API, without resorting to invoking standard AutoCAD commands, for example, using the AutoLISP command function, or sendcommand method.
Dynamic Block Parameters contained within a block definition are not exposed to the ActiveX object model and therefore cannot be modified using Visual LISP or VBA.
Such parameters are exposed to Vanilla AutoLISP by examining the DXF data stored within the Extension Dictionary of the BLOCK_RECORD entity, but such data cannot be modified using entmod, nor does it yield any relevant properties following conversion to an equivalent VLA-Object representation.
For what it's worth, you can access the Dynamic Block Parameter DXF data using the following route through the AutoLISP API:
First, obtain the BLOCK entity:
(setq bl (tblobjname "block" "YourBlockName"))
Then obtain the parent BLOCK_RECORD entity:
(setq br (cdr (assoc 330 (entget bl))))
Now obtain the Extension Dictionary from DXF group 360 (additional checks for the presence of "{ACAD_XDICTIONARY" against DXF group 102 should be used in production code):
(setq d1 (cdr (assoc 360 (entget br))))
Now search this dictionary for the ACAD_ENHANCEDBLOCK entry:
(setq d2 (dictsearch d1 "acad_enhancedblock"))
This will yield the DXF data for the ACAD_EVALUATION_GRAPH entity.
You can then iterate over the DXF group 360 within the DXF data to obtain the DXF data for each Dynamic Block Parameter found within the block definition, e.g.:
_$ (foreach dxf d2 (if (= 360 (car dxf)) (print (cdr (assoc 0 (entget (cdr dxf)))))))
"BLOCKPOLARPARAMETER"
"BLOCKPOLARGRIP"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKPOLARSTRETCHACTION"
"BLOCKFLIPPARAMETER"
"BLOCKFLIPGRIP"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKFLIPACTION"
"BLOCKVISIBILITYPARAMETER"
"BLOCKVISIBILITYGRIP"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKGRIPLOCATIONCOMPONENT"
Thanks for your reply. I'll try to do as your instruction.
– Nghia Chau
Nov 8 at 1:18
add a comment |
up vote
0
down vote
In short, it is not possible to rename Dynamic Block Visibility States directly using the LISP or VBA API, without resorting to invoking standard AutoCAD commands, for example, using the AutoLISP command function, or sendcommand method.
Dynamic Block Parameters contained within a block definition are not exposed to the ActiveX object model and therefore cannot be modified using Visual LISP or VBA.
Such parameters are exposed to Vanilla AutoLISP by examining the DXF data stored within the Extension Dictionary of the BLOCK_RECORD entity, but such data cannot be modified using entmod, nor does it yield any relevant properties following conversion to an equivalent VLA-Object representation.
For what it's worth, you can access the Dynamic Block Parameter DXF data using the following route through the AutoLISP API:
First, obtain the BLOCK entity:
(setq bl (tblobjname "block" "YourBlockName"))
Then obtain the parent BLOCK_RECORD entity:
(setq br (cdr (assoc 330 (entget bl))))
Now obtain the Extension Dictionary from DXF group 360 (additional checks for the presence of "{ACAD_XDICTIONARY" against DXF group 102 should be used in production code):
(setq d1 (cdr (assoc 360 (entget br))))
Now search this dictionary for the ACAD_ENHANCEDBLOCK entry:
(setq d2 (dictsearch d1 "acad_enhancedblock"))
This will yield the DXF data for the ACAD_EVALUATION_GRAPH entity.
You can then iterate over the DXF group 360 within the DXF data to obtain the DXF data for each Dynamic Block Parameter found within the block definition, e.g.:
_$ (foreach dxf d2 (if (= 360 (car dxf)) (print (cdr (assoc 0 (entget (cdr dxf)))))))
"BLOCKPOLARPARAMETER"
"BLOCKPOLARGRIP"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKPOLARSTRETCHACTION"
"BLOCKFLIPPARAMETER"
"BLOCKFLIPGRIP"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKFLIPACTION"
"BLOCKVISIBILITYPARAMETER"
"BLOCKVISIBILITYGRIP"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKGRIPLOCATIONCOMPONENT"
Thanks for your reply. I'll try to do as your instruction.
– Nghia Chau
Nov 8 at 1:18
add a comment |
up vote
0
down vote
up vote
0
down vote
In short, it is not possible to rename Dynamic Block Visibility States directly using the LISP or VBA API, without resorting to invoking standard AutoCAD commands, for example, using the AutoLISP command function, or sendcommand method.
Dynamic Block Parameters contained within a block definition are not exposed to the ActiveX object model and therefore cannot be modified using Visual LISP or VBA.
Such parameters are exposed to Vanilla AutoLISP by examining the DXF data stored within the Extension Dictionary of the BLOCK_RECORD entity, but such data cannot be modified using entmod, nor does it yield any relevant properties following conversion to an equivalent VLA-Object representation.
For what it's worth, you can access the Dynamic Block Parameter DXF data using the following route through the AutoLISP API:
First, obtain the BLOCK entity:
(setq bl (tblobjname "block" "YourBlockName"))
Then obtain the parent BLOCK_RECORD entity:
(setq br (cdr (assoc 330 (entget bl))))
Now obtain the Extension Dictionary from DXF group 360 (additional checks for the presence of "{ACAD_XDICTIONARY" against DXF group 102 should be used in production code):
(setq d1 (cdr (assoc 360 (entget br))))
Now search this dictionary for the ACAD_ENHANCEDBLOCK entry:
(setq d2 (dictsearch d1 "acad_enhancedblock"))
This will yield the DXF data for the ACAD_EVALUATION_GRAPH entity.
You can then iterate over the DXF group 360 within the DXF data to obtain the DXF data for each Dynamic Block Parameter found within the block definition, e.g.:
_$ (foreach dxf d2 (if (= 360 (car dxf)) (print (cdr (assoc 0 (entget (cdr dxf)))))))
"BLOCKPOLARPARAMETER"
"BLOCKPOLARGRIP"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKPOLARSTRETCHACTION"
"BLOCKFLIPPARAMETER"
"BLOCKFLIPGRIP"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKFLIPACTION"
"BLOCKVISIBILITYPARAMETER"
"BLOCKVISIBILITYGRIP"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKGRIPLOCATIONCOMPONENT"
In short, it is not possible to rename Dynamic Block Visibility States directly using the LISP or VBA API, without resorting to invoking standard AutoCAD commands, for example, using the AutoLISP command function, or sendcommand method.
Dynamic Block Parameters contained within a block definition are not exposed to the ActiveX object model and therefore cannot be modified using Visual LISP or VBA.
Such parameters are exposed to Vanilla AutoLISP by examining the DXF data stored within the Extension Dictionary of the BLOCK_RECORD entity, but such data cannot be modified using entmod, nor does it yield any relevant properties following conversion to an equivalent VLA-Object representation.
For what it's worth, you can access the Dynamic Block Parameter DXF data using the following route through the AutoLISP API:
First, obtain the BLOCK entity:
(setq bl (tblobjname "block" "YourBlockName"))
Then obtain the parent BLOCK_RECORD entity:
(setq br (cdr (assoc 330 (entget bl))))
Now obtain the Extension Dictionary from DXF group 360 (additional checks for the presence of "{ACAD_XDICTIONARY" against DXF group 102 should be used in production code):
(setq d1 (cdr (assoc 360 (entget br))))
Now search this dictionary for the ACAD_ENHANCEDBLOCK entry:
(setq d2 (dictsearch d1 "acad_enhancedblock"))
This will yield the DXF data for the ACAD_EVALUATION_GRAPH entity.
You can then iterate over the DXF group 360 within the DXF data to obtain the DXF data for each Dynamic Block Parameter found within the block definition, e.g.:
_$ (foreach dxf d2 (if (= 360 (car dxf)) (print (cdr (assoc 0 (entget (cdr dxf)))))))
"BLOCKPOLARPARAMETER"
"BLOCKPOLARGRIP"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKPOLARSTRETCHACTION"
"BLOCKFLIPPARAMETER"
"BLOCKFLIPGRIP"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKFLIPACTION"
"BLOCKVISIBILITYPARAMETER"
"BLOCKVISIBILITYGRIP"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKGRIPLOCATIONCOMPONENT"
answered Nov 7 at 18:32
Lee Mac
2,47121035
2,47121035
Thanks for your reply. I'll try to do as your instruction.
– Nghia Chau
Nov 8 at 1:18
add a comment |
Thanks for your reply. I'll try to do as your instruction.
– Nghia Chau
Nov 8 at 1:18
Thanks for your reply. I'll try to do as your instruction.
– Nghia Chau
Nov 8 at 1:18
Thanks for your reply. I'll try to do as your instruction.
– Nghia Chau
Nov 8 at 1:18
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53185237%2frenaming-dynamic-block-visibility-states-using-vba%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password