.NET

Reply
*Expert Elite*
Hallex
Posts: 1,569
Registered: ‎10-08-2008
Message 21 of 36 (373 Views)

Re: Attribute to move to block without the old ATT

09-14-2012 12:29 AM in reply to: heinz.dober

Glad I could help

Bitte shoen

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
*Expert Elite*
Hallex
Posts: 1,569
Registered: ‎10-08-2008
Message 22 of 36 (369 Views)

Re: Attribute to move to block without the old ATT

09-14-2012 12:35 AM in reply to: heinz.dober

Please, upload the  sample drawing in A2007 format

with your old block and manually inserted

the new block with attributes, I will play with it later

coz I'm a bit busy with my own now

 

~'J'~

 

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Active Contributor
heinz.dober
Posts: 37
Registered: ‎02-14-2008
Message 23 of 36 (369 Views)

Re: Attribute to move to block without the old ATT

09-14-2012 12:39 AM in reply to: Hallex

I find that the Toll me helping you.
Thanks again

 

Das finde ich Toll das sie mir so helfen.

Danke nochmals

DH
Active Contributor
heinz.dober
Posts: 37
Registered: ‎02-14-2008
Message 24 of 36 (364 Views)

Re: Attribute to move to block without the old ATT

09-14-2012 12:48 AM in reply to: Hallex

Please, upload the  sample drawing in A2007 format

with your old block and manually inserted

the new block with attributes, I will play with it later

coz I'm a bit busy with my own now

 

I now understand what it is not quite as mean

das versteh ich jetzt nicht ganz was sie da meinen

DH
Active Contributor
heinz.dober
Posts: 37
Registered: ‎02-14-2008
Message 25 of 36 (331 Views)

Re: Attribute to move to block without the old ATT

09-16-2012 01:06 AM in reply to: Hallex

Here I have a lisp what I mean.
Unfortunately, it is not who I rictig several Att.
Or in foreign blocks it also does not want to work properly

 

Hier habe ich ein Lisp wie ich das meine.

Leider läuft es nicht rictig wen ich mehrere Att habe.

Oder bei Fremdblöcken will es auch nicht richtig funktionieren

 

(defun c:attsync2 (/ _name _gettatts _lst atts e name ss)
  (vl-load-com)
  (defun _lst (ss / e n out)
    (setq n -1)
    (if	(= (type ss) 'pickset)
      (while (setq e (ssname ss (setq n (1+ n)))) (setq out (cons (vlax-ename->vla-object e) out)))
    )
  )
  (defun _attpositions (block / att result)
    (foreach att (vlax-invoke block 'getattributes)
      (setq result (cons (list (vla-get-handle att)
			       (vlax-get att 'insertionpoint)
			       (vlax-get att 'textalignmentpoint)
			 )
			 result
		   )
      )
    )
  )
  (defun _name (b)
    (cond ((vlax-property-available-p b 'effectivename) (vla-get-effectivename b))
	  ((vlax-property-available-p b 'name) (vla-get-name b))
    )
  )
  (if (and (setq e (car (entsel "\nSelect block to sync: ")))
	   (setq name (_name (vlax-ename->vla-object e)))
	   (setq ss (ssget "_x" (list (cons 0 "insert"))))
      )
    (progn (foreach x (_lst ss) (and (eq (_name x) name) (setq atts (cons (_attpositions x) atts))))
	   (command "._attsync" "_s" e "_yes")
	   (foreach x (apply 'append atts)
	     (if (and (setq e (handent (car x))) (setq e (vlax-ename->vla-object e)))
	       (progn (vl-catch-all-apply 'vlax-put (list e 'insertionpoint (cadr x)))
		      (vl-catch-all-apply 'vlax-put (list e 'textalignmentpoint (caddr x)))
	       )
	     )
	   )
    )
  )
  (princ)
)

 thank you

DH
*Expert Elite*
Alfred.NESWADBA
Posts: 8,892
Registered: ‎06-29-2007
Message 26 of 36 (323 Views)

Re: Attribute to move to block without the old ATT

09-16-2012 02:54 AM in reply to: heinz.dober

Hi,

 

brauchst Du's jetzt mit LISP oder mit dotNET? Wenn dotNET, dann welche Version hast Du ... VS2010 oder VS2012?

 

Sind die Vorgaben, dass Du bereits die Blockdefintion fertig hast und nur das eigene ATTSYNC nachlaufen soll oder muss ein neues Attribut auch erst der Blockdefinition hinzugefügt werden?

 

Ev. hast Du eine Musterzeichnung, die des Status darstellt vor Deinem eigenen ATTSYNC?

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Active Contributor
heinz.dober
Posts: 37
Registered: ‎02-14-2008
Message 27 of 36 (293 Views)

Re: Attribute to move to block without the old ATT

09-16-2012 10:11 PM in reply to: Hallex

Hallo

 

Wir haben Autocad 2013, net oder Lisp ist mir gleich.( Wobei ich weiss das ihn 3 Jahren das net wieder nicht laufen wird da änderungen vorgenommen werden bei Autodesk.)

Ich mache das zur Zeit so füge ein ATT hinzu und verwende dann das ATTsync2.

Mir ist gleich wie das Programm abläuft ich will nur ein ATT einfügen und die alten ATT sollen ihre Postition behalten.

Schade das das Autocad nicht kann.

Ist doch normal wen ich ein grosse Zeichung habe das da meine ATT einmal verschoben werden müssen.

Und das ATTSYCN von Autocad ist da nicht zu gebrauchen wenn ich ein ATT anhängen muss der verschiebt mir doch alles wieder.

Danke

 

 

DH
*Expert Elite*
Alfred.NESWADBA
Posts: 8,892
Registered: ‎06-29-2007
Message 28 of 36 (279 Views)

Re: Attribute to move to block without the old ATT

09-17-2012 07:31 AM in reply to: heinz.dober

Hi,

 

>> Mir ist gleich wie das Programm abläuft

So it seems to be not interesting of how the code looks like, you just need the functionality?

Ok, find attached two DLL's,

  • one in the directory "bin_18_00" ==> for AutoCAD 2010/2011/2012
  • one in the directory "bin_19_00" ==> for AutoCAD 2013

You can NETLOAD the corresponding DLL into your AutoCAD and start then the command AN_ATTSYNC

 

When it's started you get a dialog with a list of available blocknames in the current drawing, you can choose the blockname either in the list or with the button right to the list and selecting one blockreference.

After you selected the blockreference you'll get the attributes listed that are definied within the blockdefinition(!), activate the attributes you want to get synchronised and click "SYNC".

 

AN_AttSync_Basics01.gif

 

IMPORTANT: this is just written as is and not really tested, so first save...then execute.

If there is any feedback ==> thank you in advance! :smileywink:

(If anyone needs the source (VS2012, vb.net) leave a message here)

 

It currently does not support specials like dynamic block, unnamed blocks, annotative blockreferences.

 

HTH, - alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Active Contributor
heinz.dober
Posts: 37
Registered: ‎02-14-2008
Message 29 of 36 (271 Views)

Re: Attribute to move to block without the old ATT

09-17-2012 10:08 AM in reply to: Hallex

Super Thank you Thank you

'll Try tomorrow once, and then you give modest as it runs.

 

 

Super Danke Danke

 

Werde das morgen mal Testen, und Ihnen dann bescheid geben wie es läuft.

 

DH
Active Contributor
heinz.dober
Posts: 37
Registered: ‎02-14-2008
Message 30 of 36 (247 Views)

Re: Attribute to move to block without the old ATT

09-17-2012 10:16 PM in reply to: Hallex

Thanks for the program Work perfect for us.
I have a block because it will not work so well.

Thanks again

 

Danke das Programm Arbeite perfekt für uns.
Einen Block habe ich da will das nicht so recht funktionieren.

Danke nochmal

 

 

DH

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community