entmod a dxfcode of a BlockLinearParameter

entmod a dxfcode of a BlockLinearParameter

prountzos509
Contributor Contributor
572 Views
10 Replies
Message 1 of 11

entmod a dxfcode of a BlockLinearParameter

prountzos509
Contributor
Contributor

Is there a way to modify a dxf code of a BlockLinearParameter

(setq lst ((-1 . <Entity name: 30f5358c0b0>) (0 . "BLOCKLINEARPARAMETER") (5 . "661D63") (102 . "{ACAD_XDICTIONARY") (360 . <Entity name: 30f5358c750>) (102 . "}") (330 . <Entity name: 30f5358c0a0>) (100 . "AcDbEvalExpr") (90 . 48) (98 . 33) (99 . 329) (100 . "AcDbBlockElement") (300 . "Linear") (98 . 33) (99 . 329) (1071 . 32) (100 . "AcDbBlockParameter") (280 . 1) (281 . 0) (100 . "AcDbBlock2PtParameter") (1010 0.0 0.0 0.0) (1011 0.240209 0.549818 0.0) (170 . 4) (91 . 52) (91 . 49) (91 . 0) (91 . 0) (171 . 1) (92 . 52) (301 . "DisplacementX") (172 . 1) (93 . 52) (302 . "DisplacementY") (173 . 1) (94 . 49) (303 . "DisplacementX") (174 . 1) (95 . 49) (304 . "DisplacementY") (177 . 0) (100 . "AcDbBlockLinearParameter") (305 . "Distance1") (306 . "") (140 . 0.076861) (307 . "") (96 . 8) (141 . 0.6) (142 . 1.0) (143 . 0.1) (175 . 0)))

i have reached to this lst

and i want to (entmod (subst (cons 96 7) (assoc 96 lst) lst)) but i get the error message : 

; error: bad DXF group: (1071 . 32)

My knowledge roofed and i need some assistance

0 Likes
Accepted solutions (1)
573 Views
10 Replies
Replies (10)
Message 2 of 11

komondormrex
Mentor
Mentor

i think there is not. 1071 is a group code for the extended data supposed to be in -3 sublist, that is why you get the error.

0 Likes
Message 3 of 11

prountzos509
Contributor
Contributor

i posted the list which contains (1071 . 32) so its there for some reason

0 Likes
Message 4 of 11

komondormrex
Mentor
Mentor

yeah, it is there for some reason known to autocad developers, but getting any dxf does not necessarily mean that you just can entmod it. btw entmod 

modifies the definition of an object (entity), whereas dynamic property ain't one. so the answer is still there is not.
0 Likes
Message 5 of 11

Moshe-A
Mentor
Mentor

@prountzos509  hi,

 

what is dxf96? what property do you want to change?

maybe try activex or (command) function.

 

Moshe

 

 

0 Likes
Message 6 of 11

prountzos509
Contributor
Contributor

dxf 96 controls the dist type and 7 is used for increment 3 for none and 8 for list

furthermore dxf 141 stores the dist increment 142 the dist minimum and 143 dist maximum

So when i insert a block i want to assign linear parameters with different values on all the above without the need of doing it after

0 Likes
Message 7 of 11

prountzos509
Contributor
Contributor

The general question is :

Is there any command or a way to change those values other than the properties window ?

0 Likes
Message 8 of 11

ВeekeeCZ
Consultant
Consultant

If you don't find any better way, set those values from block editor - open editor, change the setting, close. 

 

something like...

 

(command "_.-bedit" "blockname")

(setpropertyvalue ename-of-parameter "PropertyName" value)

(command "_.bsave" "_.bclose")

0 Likes
Message 9 of 11

prountzos509
Contributor
Contributor

well initially i can (command "-bparameter" "l" "V" ...) for value set but the question still remains

i mean if you already have a block with linear parameter how you can modify its properties via coding

value of the linear parameter isits length and it can be modified with the setpropertyvalue function

 

0 Likes
Message 10 of 11

ВeekeeCZ
Consultant
Consultant
Accepted solution

Post a block and screenshot of what exactly you want to change from what to what.

 

Edit: here's a quick test on attached block

 

(defun c:test ()

  (setq n (getint "new min: "))
  
  (command "_.-bedit" "rect")

  (and (setq l (ssget "X"))
       (setq l (vl-remove-if 'listp (mapcar 'cadr (ssnamex l))))
       (setq l (vl-remove-if-not '(lambda (e) (and (not (vl-catch-all-error-p (setq x (vl-catch-all-apply 'getpropertyvalue (list e "DistanceName")))))
						   (= x "Distance1")))
		 l))
       (vl-catch-all-apply 'setpropertyvalue (list (car l) "BlockParamValueSet/Minimum" n))
       )
  
  (command "_.bsave" "_.bclose")
  )

 

0 Likes
Message 11 of 11

prountzos509
Contributor
Contributor

This is exactly what i want.

Thanks a lot. Works also with everything else even with those i dont need atm.

 

dumpallproperties and problem solved

 

btw dxf codes are different in dumpallproperties  from what i get from dictsearch method.

I mean increment is 1 instead of 7 i wrote before, list is 2 instead of 8 and none is 0 instead of 3. Strange

 

Thanks so much ВeekeeCZ for the contribution and the interest.

 

Amazed with the altitude i have to climb.

 

0 Likes