Community
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<bob.at> schreef in berichtWith
href="news:6036723@discussion.autodesk.com">news:6036723@discussion.autodesk.com...
(command "_insert" ...) and the real block name "E_ARM0102"
bob.at
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<bob.at> schreef in berichtWith
href="news:6036723@discussion.autodesk.com">news:6036723@discussion.autodesk.com...
(command "_insert" ...) and the real block name "E_ARM0102"
bob.at
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<bob.at> schreef in berichtWith
href="news:6036723@discussion.autodesk.com">news:6036723@discussion.autodesk.com...
(command "_insert" ...) and the real block name "E_ARM0102"
bob.at
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<bob.at> schreef in berichtWith
href="news:6036723@discussion.autodesk.com">news:6036723@discussion.autodesk.com...
(command "_insert" ...) and the real block name "E_ARM0102"
bob.at
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<H.vanZeeland> schreef in berichtMarcel,
href="news:6037116@discussion.autodesk.com">news:6037116@discussion.autodesk.com...
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
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<H.vanZeeland> schreef in berichtMarcel,
href="news:6037116@discussion.autodesk.com">news:6037116@discussion.autodesk.com...
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
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<H.vanZeeland> schreef in berichtMarcel,
href="news:6037116@discussion.autodesk.com">news:6037116@discussion.autodesk.com...
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
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<H.vanZeeland> schreef in berichtMarcel,
href="news:6037116@discussion.autodesk.com">news:6037116@discussion.autodesk.com...
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
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<H.vanZeeland> schreef in berichtMarcel,
href="news:6037116@discussion.autodesk.com">news:6037116@discussion.autodesk.com...
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
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<H.vanZeeland> schreef in berichtMarcel,
href="news:6037116@discussion.autodesk.com">news:6037116@discussion.autodesk.com...
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
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"M. Janmaat" <
href="mailto:m.janmaat@hiensch.nl">m.janmaat@hiensch.nl> schreef in
bericht
href="news:6037199@discussion.autodesk.com">news:6037199@discussion.autodesk.com...
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">
<H.vanZeeland> schreef in berichtMarcel,
href="news:6037116@discussion.autodesk.com">news:6037116@discussion.autodesk.com...
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
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<H.vanZeeland> schreef in berichtMarcel,
href="news:6037221@discussion.autodesk.com">news:6037221@discussion.autodesk.com...
(vla-get-IsDynamicBlock obj) or (vla-get-IsDynamicBlock
(vlax-ename->vla-object (car (entsel)))) Cheers
Harrie