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

modify dimarc without regen

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
Moshe-A
245 Views, 3 Replies

modify dimarc without regen

Hi Guys

 

a colleague turn to me yesterday with this problem...he uses dimarc some times it has a large radius. dimarc has a defpoint at the center of the arc

when he zooms to an area he 'see' the defpoint but not the dimarc and selects some objects by crossing to erase, autocad selects the dimarc (which is off screen). the result the dimarc gone.

 

so i developed this lisp to turn off visibility to dimarc center point

 

; apply dimarc center point visibility 
 (defun apply_dacp_visibility (ename / p15 blkName blocks-table BlkTblRec AcDbEntity coords^ p0)
   
  (setq elist (entget ename))
  (setq p15 (cdr (assoc '15 elist)))
  (setq blkName (cdr (assoc '2 elist)))
  (setq blocks-table (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))))
  (setq BlkTblRec (vla-item blocks-table blkName))
  
  (vlax-for AcDbEntity BlkTblRec

   (if (and
	(eq (vla-get-objectName AcDbEntity) "AcDbPoint")
         (setq coords^ (vlax-get-property AcDbEntity 'Coordinates))
         (setq p0 (vlax-safearray->list (variant-value coords^)))
         (equal (distance p0 p15) 0.0 0.1)
       )
    (vlax-put-property AcDbEntity 'visible :vlax-false) ; apply visibility
   )
 
   (vlax-release-object AcDbEntity)
   
  ); vlax-for
   
  (vlax-release-object BlkTblRec)
  (vlax-release-object blocks-table)
 )

 

every thing work fine except there is a need to a Regen in order to see the change

is there a way to skip the Regen?

 

thanks in advance

Moshe

 

 

3 REPLIES 3
Message 2 of 4
Kent1Cooper
in reply to: Moshe-A

Perhaps (entupd ename) ?

Kent Cooper, AIA
Message 3 of 4
Moshe-A
in reply to: Kent1Cooper

Kent,

 

yes you are right (as always)

 

i only used (entupd) only to update attributes

 

thank you very much

 

Moshe

 

Message 4 of 4
Moshe-A
in reply to: Kent1Cooper

Kent hi,

 

the lisp works fine (the dimarc center point visibility is disabled) but there is a problem.

 

as soon as you invoke a modify commands on the dimarc (move, copy, rotate, scale) autocad restore the point back

at first i thought autocad deletes the *D??? anonynous block and insert a new but no...it's is the same block name

 

weird that autocad goes deeply inside block definition for only moving\coping the block

 

Do you have an idea how can i solved this with out using reactors?

 

Moshe

 

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

Post to forums  

Autodesk Design & Make Report

”Boost