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

turn on/off annotative

17 REPLIES 17
SOLVED
Reply
Message 1 of 18
Moshe-A
2842 Views, 17 Replies

turn on/off annotative

Hi Guys,

 

when a text is selected, in properties palette the Annotative field can be turned on/off  - how can i do it programatically?

 

activex doesn't not have a propertiy for it. i presume it is in xrecords but could not find it.

 

 

thanks in advanced

Moshe

 

 

17 REPLIES 17
Message 2 of 18
pbejse
in reply to: Moshe-A


@Moshe-A wrote:

Hi Guys,

 

when a text is selected, in properties palette the Annotative field can be turned on/off  - how can i do it programatically?

 

activex doesn't not have a propertiy for it. i presume it is in xrecords but could not find it.

 

 

thanks in advanced

Moshe

 

 


The most simple way i can think of is:

 

(command "_chprop" (ssget "_X" '((0 . "MTEXT,TEXT")(410 . "MODEL"))) "" "A" "No" "")

 

(command "_chprop" (ssget "_X" '((0 . "MTEXT,TEXT")(410 . "MODEL"))) "" "A" "Yes" "")

 

(command "_chprop" entity "" "A" "Yes" "")

 

Message 3 of 18
Moshe-A
in reply to: pbejse

Ok but if it's an attribute?

 

 

 

Message 4 of 18
pbejse
in reply to: Moshe-A


@Moshe-A wrote:

Ok but if it's an attribute?


Good question Moshe-A. never thought of that Smiley Very Happy,

Message 5 of 18
Moshe-A
in reply to: pbejse

Sorry by mistake i pressed 'Accept as Solution'

 

On my current application have some attribute blocks that are placed in at 1X1 scale but the text style is annotative. i would like to give the user an option to turn off the annotation when they are 100% sure these blocks are in the right scale (and it won't be changed in future)

 

Thank you very much for your help

Moshe

 

 

Message 6 of 18
pbejse
in reply to: Moshe-A


@Moshe-A wrote:

Sorry by mistake i pressed 'Accept as Solution'

 

On my current application have some attribute blocks that are placed in at 1X1 scale but the text style is annotative. i would like to give the user an option to turn off the annotation when they are 100% sure these blocks are in the right scale (and it won't be changed in future)

 

Thank you very much for your help

Moshe

 

 


No worries. i already took care of that.

 

I'll have a look see-later  and see what i can dig up.

 

 

Message 7 of 18
hmsilva
in reply to: Moshe-A

Moshe,

to remove anotatividade to a text

 

(defun c:test (/ ed)
  (setq ed (entget (car (entsel)) '("AcadAnnotative")))
  (setq	ed (subst (list	-3
			(list "AcadAnnotative"
			      '(1000 . "AnnotativeData")
			      '(1002 . "{")
			      '(1070 . 1)
			      '(1070 . 0)
			      '(1002 . "}")
			)
		  )
		  (assoc -3 ed)
		  ed
	   )
  )
  (entmod ed)
  (princ)
)

 

hope that helps

Henrique

 

EESignature

Message 8 of 18
Moshe-A
in reply to: hmsilva

Henrique,

 

it looks like the ATTRIB does not holds this xdata so it must be in ATTDEF?

 

i thought i could turn each attrib annotation to off?

 

 

 

 

 

 

Message 9 of 18
hmsilva
in reply to: Moshe-A

Moshe,

just try

 

(setq ed (entget (car (nentsel)) '("AcadAnnotative")))

 

Henrique

EESignature

Message 10 of 18
Moshe-A
in reply to: hmsilva

Henrique,

 

Yes Smiley Very Happy you are right.

 

thank you very much for this help

 

Moshe

 

Message 11 of 18
hmsilva
in reply to: Moshe-A

Moshe,

just for testing

 

(defun c:test (/ ed blk att)
  (setq blk (car (entsel "\nSelect a block to remove Annotative prop from text: ")))
  (setq att blk)
  (if (assoc 66 (entget blk))
    (while (= (cdr (assoc 0 (entget (setq att (entnext att))))) "ATTRIB")
      (setq ed (entget att '("AcadAnnotative")))
      (setq ed (subst (list -3
			    (list "AcadAnnotative" '(1000
						     .
						     "AnnotativeData"
						    ) '(1002 . "{")
				  '(1070 . 1) '(1070 . 0) '(1002 . "}"))
		      )
		      (assoc -3 ed)
		      ed
	       )
      )
      (entmod ed)
    )
  )
  (princ)
)

 

hope that helps

Henrique

EESignature

Message 12 of 18
hmsilva
in reply to: Moshe-A

You're welcome, Moshe

glad i could help

 

Henrique

EESignature

Message 13 of 18
Moshe-A
in reply to: hmsilva

Henrique & pbejse

 

here is an update on this case

 

althought the disable for the annotative attribute is done the behaviour of autocad is weird

some time changing the annotation scale does have no effect on them some time it does

 

it look like autocad remembers the previous annotation scale that were apply to those objects

and do change the scale even if annotative is off  and it may do this with an unmatched scale to the

current annotation selected scale

 

 

Moshe

Message 14 of 18
hmsilva
in reply to: Moshe-A

Moshe,
I can't reproduce that behavior, if possible attach a sample dwg

Henrique

EESignature

Message 15 of 18
Moshe-A
in reply to: hmsilva

sorry henrique

 

was tired last night, i will send it tonight

 

moshe

Message 16 of 18
Moshe-A
in reply to: Moshe-A

Ok - here it is

 

i have disable annotative in all 3 attributes

 

did more checks and it look like autocad do remember the prevoius scales that were applied before turnning annotative off and restore these scale as you change annotation scale

 

thought i would delete those scale from block (or attributes) but could not find them there

 

maybe this happends due this is too complex object? (e.g dynamic annotative block with attributes?)

 

 

thanks

moshe

 

Message 17 of 18
Moshe-A
in reply to: hmsilva

switched to google chrome - hope this will upload the file

 

yes!!! Smiley Very Happy

Message 18 of 18
hmsilva
in reply to: Moshe-A

Moshe,

also can't find where is stored the annotative property after being disabled...

I'll keep looking...

 

Henrique

EESignature

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

Post to forums  

Autodesk Design & Make Report

”Boost