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

Field value pulled from a separate Block attribute value via point and click

5 REPLIES 5
Reply
Message 1 of 6
cmacdonald
293 Views, 5 Replies

Field value pulled from a separate Block attribute value via point and click

Hello all,

 

Video attached for clarity (hopefully).  I am trying to find out if anyone has a LISP where I am able to change a linked field value by selecting said object and reassigning the field link to a different object via a point and click method that bypasses the edit field dialogue boxes.  If it's even possible.  Hopefully I explained that correctly.  

TIA!

 

-Chris

Tags (1)
Labels (2)
5 REPLIES 5
Message 2 of 6
Sea-Haven
in reply to: cmacdonald

You need to edit the ID of the field to be the ID of the new object. Post a sample dwg if possible.

Message 3 of 6
cmacdonald
in reply to: Sea-Haven

Hello @Sea-Haven,

 

Thanks for responding.  See attached sample.  Let me know if anything more is needed.

Message 4 of 6
paullimapa
in reply to: cmacdonald

AtbLnk.lsp seems to work on your dwg


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 5 of 6
komondormrex
in reply to: cmacdonald

hi there,

check the following

(defun c:inherit_another_block (/ nentsel_data target_attribute attribute_referenced_tag target_block another_block attribute_found)
	(setq nentsel_data (nentsel "\nPick target attribute: ")
	      target_attribute (vlax-ename->vla-object (cdr (assoc -1 (entget (car nentsel_data))))) 
	      attribute_referenced_tag (cdr (assoc 2(entget (cdr (assoc 331 (entget (cdr (assoc 360 (entget (cdr (assoc 360 (entget (cdr (assoc 360 (entget (cdr (assoc 360 (entget (car nentsel_data)))))))))))))))))))
	)
	(if (= 4 (length nentselp_data))
		(setq target_block (vlax-ename->vla-object (car (last nentselp_data))))
		(setq target_block (vlax-ename->vla-object (ssname (ssget (cadr nentsel_data)) 0)))
	)
	(terpri)
	(while (and
	     	   (setq another_block (car (entsel "\nPick another target_block to reference field: ")))
		   (not
		     	(and
			     (= (cdr (assoc 0 (entget another_block))) "INSERT")
		      	     (equal '(66 . 1) (assoc 66 (entget another_block)))
			     (vl-some '(lambda (attribute) (= attribute_referenced_tag (vla-get-tagstring (setq attribute_found attribute))))
			     	       (vlax-invoke (vlax-ename->vla-object another_block) 'getattributes)
			     )
		        )
		   )
		   (princ "wrong block")
	       )
	)
  	(vla-put-textstring target_attribute (strcat "%<\\AcObjProp Object(%<\\_ObjId " (itoa (vla-get-objectid attribute_found)) ">%).TextString \\f \"%tc1\">%"))
  	(vla-regen (vla-get-activedocument (vlax-get-acad-object)) acactiveviewport)
)
Message 6 of 6
cmacdonald
in reply to: cmacdonald

Thanks for your responses.  I have not had a minute to test these out yet.  I hope to free some time up this week.  Will report back.

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report