Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Insertion of a dynamic block

18 REPLIES 18
Reply
Message 1 of 19
Anonymous
270 Views, 18 Replies

Insertion of a dynamic block

Hello,

I have obtained the name of a dynamic block.

For example;
Block Name: "E_ARM0102"
Anonymous Name: "*U167"

But how do I insert this block?

Kind regards,

M
18 REPLIES 18
Message 2 of 19
bob.at
in reply to: Anonymous

With (command "_insert" ...) and the real block name "E_ARM0102"

bob.at
Message 3 of 19
Anonymous
in reply to: Anonymous

Thanks for reply,

But when I do that, I get the original block.

But how do I insert it dynamically altered that it will look like *U167?

In the dynamicly altered version of the block some items are invisible.

Kind regards,

M
schreef in bericht news:6036723@discussion.autodesk.com...
With (command "_insert" ...) and the real block name "E_ARM0102" bob.at
Message 4 of 19
Anonymous
in reply to: Anonymous

Thanks for reply,

But when I do that, I get the original block.

But how do I insert it dynamically altered that it will look like *U167?

In the dynamicly altered version of the block some items are invisible.

Kind regards,

M
schreef in bericht news:6036723@discussion.autodesk.com...
With (command "_insert" ...) and the real block name "E_ARM0102" bob.at
Message 5 of 19
Anonymous
in reply to: Anonymous

Thanks for reply,

But when I do that, I get the original block.

But how do I insert it dynamically altered that it will look like *U167?

In the dynamicly altered version of the block some items are invisible.

Kind regards,

M
schreef in bericht news:6036723@discussion.autodesk.com...
With (command "_insert" ...) and the real block name "E_ARM0102" bob.at
Message 6 of 19
Anonymous
in reply to: Anonymous


Thanks for reply,

But when I do that, I get the original
block.

But how do I insert it dynamically altered that it will look like
*U167?

In the dynamicly altered version of the block some items are
invisible.

Kind regards,

M


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
With
(command "_insert" ...) and the real block name "E_ARM0102"
bob.at
Message 7 of 19
Anonymous
in reply to: Anonymous


Thanks for reply,

But when I do that, I get the original
block.

But how do I insert it dynamically altered that it will look like
*U167?

In the dynamicly altered version of the block some items are
invisible.

Kind regards,

M


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
With
(command "_insert" ...) and the real block name "E_ARM0102"
bob.at
Message 8 of 19
Anonymous
in reply to: Anonymous


Thanks for reply,

But when I do that, I get the original
block.

But how do I insert it dynamically altered that it will look like
*U167?

In the dynamicly altered version of the block some items are
invisible.

Kind regards,

M


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
With
(command "_insert" ...) and the real block name "E_ARM0102"
bob.at
Message 9 of 19
Anonymous
in reply to: Anonymous


Thanks for reply,

But when I do that, I get the original
block.

But how do I insert it dynamically altered that it will look like
*U167?

In the dynamicly altered version of the block some items are
invisible.

Kind regards,

M


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
With
(command "_insert" ...) and the real block name "E_ARM0102"
bob.at
Message 10 of 19
H.vanZeeland
in reply to: Anonymous

Marcel,


Get the dynamic properties from the dynamic block *U167
And put the same properties to the new inserted block

(DynamicProps (car (entsel)) "Visibility" nil) get the visible state of the block in my case
("C/C 250" ("C/C 100" "C/C 150" "C/C 200" "C/C 250" "C/C 300" "C/C 350")) where the first element is the visible state and the second are all the status.

(DynamicProps (car (entsel)) "Visibility" "C/C 300") put it to visible state to "C/C 300"




;----------------------------------------------------------- get-variant-value -----
; Function Generic/recusive variant/safearray -> lisp type
; Arguments: 1
; var =
; Syntax:
(defun get-variant-value (var)
(cond ((eq (type var) 'variant) (get-variant-value (vlax-variant-value var)))
((eq (type var) 'safearray)
(mapcar 'get-variant-value (vlax-safearray->list var))
)
(t var)
)
)
;----------------------------------------------------------- DynamicProps -----
; Function retrieve or set properties from a dynamic block
; (DynamicProps (car (entsel)) "Visibility" nil)
; (DynamicProps (car (entsel)) "Visibility" "C/C 300")
; (DynamicProps (car (entsel)) "" nil)
; (DynamicProps (car (entsel)) "Pipe length" 2000.0)
(defun DynamicProps (ename propname value / obj prpL cla cll prp)
(setq obj (if (= (type ename) 'VLA-OBJECT) ename (vlax-ename->vla-object ename)))
(setq prpL (vlax-safearray->list (vlax-variant-value (vla-getdynamicblockproperties obj))))
(setq return (if (setq prp (vl-remove-if-not (function (lambda(x)(= (vlax-get-property x 'PropertyName) propname))) prpL))
(mapcar (function (lambda(v)
(if (and (/= value nil)(vlax-property-available-p v 'Value)(/= (type value)'LIST))
(progn (vlax-put-property v 'Value value)(vla-update obj))
)
(if (and (vlax-property-available-p v 'AllowedValues)(safearray-value (vlax-variant-value(vlax-get-property v 'AllowedValues))))
(list (get-variant-value (vlax-get-property v 'Value))
(get-variant-value (vlax-get-property v 'AllowedValues))
)
(get-variant-value (vlax-get-property v 'Value))
))) prp
)
(mapcar (function (lambda(v)(list (vla-get-propertyName v)(get-variant-value (vlax-get-property v 'Value)) v))) prpL)
))
return
)


Hope this helps

Cheers
Harrie
Message 11 of 19
Anonymous
in reply to: Anonymous


Thanks Harrie,

 

I'll check it out.

 

M


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Marcel,
Get the dynamic properties from the dynamic block *U167 And put the same
properties to the new inserted block (DynamicProps (car (entsel)) "Visibility"
nil) get the visible state of the block in my case ("C/C 250" ("C/C 100" "C/C
150" "C/C 200" "C/C 250" "C/C 300" "C/C 350")) where the first element is the
visible state and the second are all the status. (DynamicProps (car (entsel))
"Visibility" "C/C 300") put it to visible state to "C/C 300"
;----------------------------------------------------------- get-variant-value
----- ; Function Generic/recusive variant/safearray -> lisp type ;
Arguments: 1 ; var = ; Syntax: (defun get-variant-value (var) (cond ((eq (type
var) 'variant) (get-variant-value (vlax-variant-value var))) ((eq (type var)
'safearray) (mapcar 'get-variant-value (vlax-safearray->list var)) ) (t
var) ) ) ;-----------------------------------------------------------
DynamicProps ----- ; Function retrieve or set properties from a dynamic block
; (DynamicProps (car (entsel)) "Visibility" nil) ; (DynamicProps (car
(entsel)) "Visibility" "C/C 300") ; (DynamicProps (car (entsel)) "" nil) ;
(DynamicProps (car (entsel)) "Pipe length" 2000.0) (defun DynamicProps (ename
propname value / obj prpL cla cll prp) (setq obj (if (= (type ename)
'VLA-OBJECT) ename (vlax-ename->vla-object ename))) (setq prpL
(vlax-safearray->list (vlax-variant-value (vla-getdynamicblockproperties
obj)))) (setq return (if (setq prp (vl-remove-if-not (function (lambda(x)(=
(vlax-get-property x 'PropertyName) propname))) prpL)) (mapcar (function
(lambda(v) (if (and (/= value nil)(vlax-property-available-p v 'Value)(/=
(type value)'LIST)) (progn (vlax-put-property v 'Value value)(vla-update obj))
) (if (and (vlax-property-available-p v 'AllowedValues)(safearray-value
(vlax-variant-value(vlax-get-property v 'AllowedValues)))) (list
(get-variant-value (vlax-get-property v 'Value)) (get-variant-value
(vlax-get-property v 'AllowedValues)) ) (get-variant-value (vlax-get-property
v 'Value)) ))) prp ) (mapcar (function (lambda(v)(list (vla-get-propertyName
v)(get-variant-value (vlax-get-property v 'Value)) v))) prpL) )) return ) Hope
this helps Cheers Harrie
Message 12 of 19
Anonymous
in reply to: Anonymous


Thanks Harrie,

 

I'll check it out.

 

M


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Marcel,
Get the dynamic properties from the dynamic block *U167 And put the same
properties to the new inserted block (DynamicProps (car (entsel)) "Visibility"
nil) get the visible state of the block in my case ("C/C 250" ("C/C 100" "C/C
150" "C/C 200" "C/C 250" "C/C 300" "C/C 350")) where the first element is the
visible state and the second are all the status. (DynamicProps (car (entsel))
"Visibility" "C/C 300") put it to visible state to "C/C 300"
;----------------------------------------------------------- get-variant-value
----- ; Function Generic/recusive variant/safearray -> lisp type ;
Arguments: 1 ; var = ; Syntax: (defun get-variant-value (var) (cond ((eq (type
var) 'variant) (get-variant-value (vlax-variant-value var))) ((eq (type var)
'safearray) (mapcar 'get-variant-value (vlax-safearray->list var)) ) (t
var) ) ) ;-----------------------------------------------------------
DynamicProps ----- ; Function retrieve or set properties from a dynamic block
; (DynamicProps (car (entsel)) "Visibility" nil) ; (DynamicProps (car
(entsel)) "Visibility" "C/C 300") ; (DynamicProps (car (entsel)) "" nil) ;
(DynamicProps (car (entsel)) "Pipe length" 2000.0) (defun DynamicProps (ename
propname value / obj prpL cla cll prp) (setq obj (if (= (type ename)
'VLA-OBJECT) ename (vlax-ename->vla-object ename))) (setq prpL
(vlax-safearray->list (vlax-variant-value (vla-getdynamicblockproperties
obj)))) (setq return (if (setq prp (vl-remove-if-not (function (lambda(x)(=
(vlax-get-property x 'PropertyName) propname))) prpL)) (mapcar (function
(lambda(v) (if (and (/= value nil)(vlax-property-available-p v 'Value)(/=
(type value)'LIST)) (progn (vlax-put-property v 'Value value)(vla-update obj))
) (if (and (vlax-property-available-p v 'AllowedValues)(safearray-value
(vlax-variant-value(vlax-get-property v 'AllowedValues)))) (list
(get-variant-value (vlax-get-property v 'Value)) (get-variant-value
(vlax-get-property v 'AllowedValues)) ) (get-variant-value (vlax-get-property
v 'Value)) ))) prp ) (mapcar (function (lambda(v)(list (vla-get-propertyName
v)(get-variant-value (vlax-get-property v 'Value)) v))) prpL) )) return ) Hope
this helps Cheers Harrie
Message 13 of 19
Anonymous
in reply to: Anonymous


Thanks Harrie,

 

I'll check it out.

 

M


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Marcel,
Get the dynamic properties from the dynamic block *U167 And put the same
properties to the new inserted block (DynamicProps (car (entsel)) "Visibility"
nil) get the visible state of the block in my case ("C/C 250" ("C/C 100" "C/C
150" "C/C 200" "C/C 250" "C/C 300" "C/C 350")) where the first element is the
visible state and the second are all the status. (DynamicProps (car (entsel))
"Visibility" "C/C 300") put it to visible state to "C/C 300"
;----------------------------------------------------------- get-variant-value
----- ; Function Generic/recusive variant/safearray -> lisp type ;
Arguments: 1 ; var = ; Syntax: (defun get-variant-value (var) (cond ((eq (type
var) 'variant) (get-variant-value (vlax-variant-value var))) ((eq (type var)
'safearray) (mapcar 'get-variant-value (vlax-safearray->list var)) ) (t
var) ) ) ;-----------------------------------------------------------
DynamicProps ----- ; Function retrieve or set properties from a dynamic block
; (DynamicProps (car (entsel)) "Visibility" nil) ; (DynamicProps (car
(entsel)) "Visibility" "C/C 300") ; (DynamicProps (car (entsel)) "" nil) ;
(DynamicProps (car (entsel)) "Pipe length" 2000.0) (defun DynamicProps (ename
propname value / obj prpL cla cll prp) (setq obj (if (= (type ename)
'VLA-OBJECT) ename (vlax-ename->vla-object ename))) (setq prpL
(vlax-safearray->list (vlax-variant-value (vla-getdynamicblockproperties
obj)))) (setq return (if (setq prp (vl-remove-if-not (function (lambda(x)(=
(vlax-get-property x 'PropertyName) propname))) prpL)) (mapcar (function
(lambda(v) (if (and (/= value nil)(vlax-property-available-p v 'Value)(/=
(type value)'LIST)) (progn (vlax-put-property v 'Value value)(vla-update obj))
) (if (and (vlax-property-available-p v 'AllowedValues)(safearray-value
(vlax-variant-value(vlax-get-property v 'AllowedValues)))) (list
(get-variant-value (vlax-get-property v 'Value)) (get-variant-value
(vlax-get-property v 'AllowedValues)) ) (get-variant-value (vlax-get-property
v 'Value)) ))) prp ) (mapcar (function (lambda(v)(list (vla-get-propertyName
v)(get-variant-value (vlax-get-property v 'Value)) v))) prpL) )) return ) Hope
this helps Cheers Harrie
Message 14 of 19
Anonymous
in reply to: Anonymous


Thanks Harrie,

 

I'll check it out.

 

M


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Marcel,
Get the dynamic properties from the dynamic block *U167 And put the same
properties to the new inserted block (DynamicProps (car (entsel)) "Visibility"
nil) get the visible state of the block in my case ("C/C 250" ("C/C 100" "C/C
150" "C/C 200" "C/C 250" "C/C 300" "C/C 350")) where the first element is the
visible state and the second are all the status. (DynamicProps (car (entsel))
"Visibility" "C/C 300") put it to visible state to "C/C 300"
;----------------------------------------------------------- get-variant-value
----- ; Function Generic/recusive variant/safearray -> lisp type ;
Arguments: 1 ; var = ; Syntax: (defun get-variant-value (var) (cond ((eq (type
var) 'variant) (get-variant-value (vlax-variant-value var))) ((eq (type var)
'safearray) (mapcar 'get-variant-value (vlax-safearray->list var)) ) (t
var) ) ) ;-----------------------------------------------------------
DynamicProps ----- ; Function retrieve or set properties from a dynamic block
; (DynamicProps (car (entsel)) "Visibility" nil) ; (DynamicProps (car
(entsel)) "Visibility" "C/C 300") ; (DynamicProps (car (entsel)) "" nil) ;
(DynamicProps (car (entsel)) "Pipe length" 2000.0) (defun DynamicProps (ename
propname value / obj prpL cla cll prp) (setq obj (if (= (type ename)
'VLA-OBJECT) ename (vlax-ename->vla-object ename))) (setq prpL
(vlax-safearray->list (vlax-variant-value (vla-getdynamicblockproperties
obj)))) (setq return (if (setq prp (vl-remove-if-not (function (lambda(x)(=
(vlax-get-property x 'PropertyName) propname))) prpL)) (mapcar (function
(lambda(v) (if (and (/= value nil)(vlax-property-available-p v 'Value)(/=
(type value)'LIST)) (progn (vlax-put-property v 'Value value)(vla-update obj))
) (if (and (vlax-property-available-p v 'AllowedValues)(safearray-value
(vlax-variant-value(vlax-get-property v 'AllowedValues)))) (list
(get-variant-value (vlax-get-property v 'Value)) (get-variant-value
(vlax-get-property v 'AllowedValues)) ) (get-variant-value (vlax-get-property
v 'Value)) ))) prp ) (mapcar (function (lambda(v)(list (vla-get-propertyName
v)(get-variant-value (vlax-get-property v 'Value)) v))) prpL) )) return ) Hope
this helps Cheers Harrie
Message 15 of 19
Anonymous
in reply to: Anonymous


Ok Harrie,

 

Thanks so far.

 

I got this result;

 

For block A (default insert);

(("Standaard" ("Standaard" "Spatwaterdicht")))


For block A (dynamically changed);

(("Spatwaterdicht" ("Standaard"
"Spatwaterdicht")))

 

But how do I insert this block to appear as the
dynamically changed?

 

M


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Marcel,
Get the dynamic properties from the dynamic block *U167 And put the same
properties to the new inserted block (DynamicProps (car (entsel)) "Visibility"
nil) get the visible state of the block in my case ("C/C 250" ("C/C 100" "C/C
150" "C/C 200" "C/C 250" "C/C 300" "C/C 350")) where the first element is the
visible state and the second are all the status. (DynamicProps (car (entsel))
"Visibility" "C/C 300") put it to visible state to "C/C 300"
;----------------------------------------------------------- get-variant-value
----- ; Function Generic/recusive variant/safearray -> lisp type ;
Arguments: 1 ; var = ; Syntax: (defun get-variant-value (var) (cond ((eq (type
var) 'variant) (get-variant-value (vlax-variant-value var))) ((eq (type var)
'safearray) (mapcar 'get-variant-value (vlax-safearray->list var)) ) (t
var) ) ) ;-----------------------------------------------------------
DynamicProps ----- ; Function retrieve or set properties from a dynamic block
; (DynamicProps (car (entsel)) "Visibility" nil) ; (DynamicProps (car
(entsel)) "Visibility" "C/C 300") ; (DynamicProps (car (entsel)) "" nil) ;
(DynamicProps (car (entsel)) "Pipe length" 2000.0) (defun DynamicProps (ename
propname value / obj prpL cla cll prp) (setq obj (if (= (type ename)
'VLA-OBJECT) ename (vlax-ename->vla-object ename))) (setq prpL
(vlax-safearray->list (vlax-variant-value (vla-getdynamicblockproperties
obj)))) (setq return (if (setq prp (vl-remove-if-not (function (lambda(x)(=
(vlax-get-property x 'PropertyName) propname))) prpL)) (mapcar (function
(lambda(v) (if (and (/= value nil)(vlax-property-available-p v 'Value)(/=
(type value)'LIST)) (progn (vlax-put-property v 'Value value)(vla-update obj))
) (if (and (vlax-property-available-p v 'AllowedValues)(safearray-value
(vlax-variant-value(vlax-get-property v 'AllowedValues)))) (list
(get-variant-value (vlax-get-property v 'Value)) (get-variant-value
(vlax-get-property v 'AllowedValues)) ) (get-variant-value (vlax-get-property
v 'Value)) ))) prp ) (mapcar (function (lambda(v)(list (vla-get-propertyName
v)(get-variant-value (vlax-get-property v 'Value)) v))) prpL) )) return ) Hope
this helps Cheers Harrie
Message 16 of 19
Anonymous
in reply to: Anonymous


Ok Harrie,

 

Thanks so far.

 

I got this result;

 

For block A (default insert);

(("Standaard" ("Standaard" "Spatwaterdicht")))


For block A (dynamically changed);

(("Spatwaterdicht" ("Standaard"
"Spatwaterdicht")))

 

But how do I insert this block to appear as the
dynamically changed?

 

M


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Marcel,
Get the dynamic properties from the dynamic block *U167 And put the same
properties to the new inserted block (DynamicProps (car (entsel)) "Visibility"
nil) get the visible state of the block in my case ("C/C 250" ("C/C 100" "C/C
150" "C/C 200" "C/C 250" "C/C 300" "C/C 350")) where the first element is the
visible state and the second are all the status. (DynamicProps (car (entsel))
"Visibility" "C/C 300") put it to visible state to "C/C 300"
;----------------------------------------------------------- get-variant-value
----- ; Function Generic/recusive variant/safearray -> lisp type ;
Arguments: 1 ; var = ; Syntax: (defun get-variant-value (var) (cond ((eq (type
var) 'variant) (get-variant-value (vlax-variant-value var))) ((eq (type var)
'safearray) (mapcar 'get-variant-value (vlax-safearray->list var)) ) (t
var) ) ) ;-----------------------------------------------------------
DynamicProps ----- ; Function retrieve or set properties from a dynamic block
; (DynamicProps (car (entsel)) "Visibility" nil) ; (DynamicProps (car
(entsel)) "Visibility" "C/C 300") ; (DynamicProps (car (entsel)) "" nil) ;
(DynamicProps (car (entsel)) "Pipe length" 2000.0) (defun DynamicProps (ename
propname value / obj prpL cla cll prp) (setq obj (if (= (type ename)
'VLA-OBJECT) ename (vlax-ename->vla-object ename))) (setq prpL
(vlax-safearray->list (vlax-variant-value (vla-getdynamicblockproperties
obj)))) (setq return (if (setq prp (vl-remove-if-not (function (lambda(x)(=
(vlax-get-property x 'PropertyName) propname))) prpL)) (mapcar (function
(lambda(v) (if (and (/= value nil)(vlax-property-available-p v 'Value)(/=
(type value)'LIST)) (progn (vlax-put-property v 'Value value)(vla-update obj))
) (if (and (vlax-property-available-p v 'AllowedValues)(safearray-value
(vlax-variant-value(vlax-get-property v 'AllowedValues)))) (list
(get-variant-value (vlax-get-property v 'Value)) (get-variant-value
(vlax-get-property v 'AllowedValues)) ) (get-variant-value (vlax-get-property
v 'Value)) ))) prp ) (mapcar (function (lambda(v)(list (vla-get-propertyName
v)(get-variant-value (vlax-get-property v 'Value)) v))) prpL) )) return ) Hope
this helps Cheers Harrie
Message 17 of 19
Anonymous
in reply to: Anonymous


Never mind.

 

I've got it...

 

Could you als tell me how to check wether a block
is a dynamic block using its entityname?

 

M

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">


Ok Harrie,

 

Thanks so far.

 

I got this result;

 

For block A (default insert);

(("Standaard" ("Standaard" "Spatwaterdicht")))


For block A (dynamically changed);

(("Spatwaterdicht" ("Standaard"
"Spatwaterdicht")))

 

But how do I insert this block to appear as the
dynamically changed?

 

M


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Marcel,
Get the dynamic properties from the dynamic block *U167 And put the same
properties to the new inserted block (DynamicProps (car (entsel))
"Visibility" nil) get the visible state of the block in my case ("C/C 250"
("C/C 100" "C/C 150" "C/C 200" "C/C 250" "C/C 300" "C/C 350")) where the
first element is the visible state and the second are all the status.
(DynamicProps (car (entsel)) "Visibility" "C/C 300") put it to visible state
to "C/C 300" ;-----------------------------------------------------------
get-variant-value ----- ; Function Generic/recusive variant/safearray ->
lisp type ; Arguments: 1 ; var = ; Syntax: (defun get-variant-value (var)
(cond ((eq (type var) 'variant) (get-variant-value (vlax-variant-value
var))) ((eq (type var) 'safearray) (mapcar 'get-variant-value
(vlax-safearray->list var)) ) (t var) ) )
;----------------------------------------------------------- DynamicProps
----- ; Function retrieve or set properties from a dynamic block ;
(DynamicProps (car (entsel)) "Visibility" nil) ; (DynamicProps (car
(entsel)) "Visibility" "C/C 300") ; (DynamicProps (car (entsel)) "" nil) ;
(DynamicProps (car (entsel)) "Pipe length" 2000.0) (defun DynamicProps
(ename propname value / obj prpL cla cll prp) (setq obj (if (= (type ename)
'VLA-OBJECT) ename (vlax-ename->vla-object ename))) (setq prpL
(vlax-safearray->list (vlax-variant-value (vla-getdynamicblockproperties
obj)))) (setq return (if (setq prp (vl-remove-if-not (function (lambda(x)(=
(vlax-get-property x 'PropertyName) propname))) prpL)) (mapcar (function
(lambda(v) (if (and (/= value nil)(vlax-property-available-p v 'Value)(/=
(type value)'LIST)) (progn (vlax-put-property v 'Value value)(vla-update
obj)) ) (if (and (vlax-property-available-p v
'AllowedValues)(safearray-value (vlax-variant-value(vlax-get-property v
'AllowedValues)))) (list (get-variant-value (vlax-get-property v 'Value))
(get-variant-value (vlax-get-property v 'AllowedValues)) )
(get-variant-value (vlax-get-property v 'Value)) ))) prp ) (mapcar (function
(lambda(v)(list (vla-get-propertyName v)(get-variant-value
(vlax-get-property v 'Value)) v))) prpL) )) return ) Hope this helps Cheers
Harrie
Message 18 of 19
H.vanZeeland
in reply to: Anonymous

Marcel,

(vla-get-IsDynamicBlock obj)

or


(vla-get-IsDynamicBlock (vlax-ename->vla-object (car (entsel))))


Cheers
Harrie
Message 19 of 19
Anonymous
in reply to: Anonymous


Thanx!


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Marcel,
(vla-get-IsDynamicBlock obj) or (vla-get-IsDynamicBlock
(vlax-ename->vla-object (car (entsel)))) Cheers
Harrie

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

Post to forums  

Autodesk Design & Make Report

”Boost