Multiple Identical Attributes in Title Block - too much typi
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Multiple Identical Attributes in Title Block - too much typi
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization
Author Message
GaryDF
Guest





Posted: Fri Jan 07, 2005 2:14 am    Post subject: Re: Multiple Identical Attributes in Title Block - too much Reply with quote

Works fine, I was selecting an xref file when I tested it....before....without
knowing it

Gary

"T.Willey" <nospam@address.withheld> wrote in message
news:15645506.1105044390789.JavaMail.jive@jiveforum1.autodesk.com...
Quote:
Once you select a block, it read the attributes... oh.. maybe add a
(vl-load-com). But it is supposed to read the attributes from the block, then it

popultes the left side with all the tag names for the block. If it doesn't work
for you still, maybe post the block, and I will see what is wrong.
Quote:

Tim


Back to top
T.Willey
Guest





Posted: Fri Jan 07, 2005 2:26 am    Post subject: Re: Multiple Identical Attributes in Title Block - too much Reply with quote

I guess I could put some tests into it, but don't have as much time for it as I would like, so I put it out as is.

Tim
Back to top
Doug
Guest





Posted: Fri Jan 07, 2005 6:07 pm    Post subject: Re: Multiple Identical Attributes in Title Block - too much Reply with quote

I tried it but couldn't load it, either by "dragging" it in like I can with
LSP, or by using Tools, Load Application.

Doug

"T.Willey" <nospam@address.withheld> wrote in message
news:11624778.1105042386714.JavaMail.jive@jiveforum1.autodesk.com...
Quote:
See if this will work for you. It is a dialog version, and it seems to
work here.

Tim

ps. Just change the attached file extension from txt to dcl.

(defun c:CopyAttValue (/ Ent Obj AttList DiaLoad MasterAtt ChangeAtts)

(command "_.undo" "_end")
(command "_.undo" "_group")
(if (setq Ent (entsel "\n Select block:"))
(progn
(setq Obj (vlax-ename->vla-object (car Ent)))
(setq AttList (tmw:Var->Safe (vla-GetAttributes Obj)))
(setq AttList (vl-sort AttList '(lambda (a b) (< (vla-get-TagString a)
(vla-get-TagString b)))))
(setq DiaLoad (load_dialog "CopyAtt.dcl"))
(if (not (new_dialog "CopyAtt" DiaLoad))
(exit)
)
(start_list "MasterList" 3)
(mapcar '(lambda (x) (add_list (vla-get-TagString x))) AttList)
(end_list)
(action_tile "MasterList" "(if (= $reason 4) (ChangeLists (get_tile
\"MasterList\")))")
(action_tile "CopyFrom" "(if (= $reason 4) (sub-Remove (get_tile
\"CopyFrom\") \"\"))")
(action_tile "CopyTo" "(if (= $reason 4) (sub-Remove \"\" (get_tile
\"CopyTo\")))")
(action_tile "Add" "(ChangeLists (get_tile \"MasterList\"))")
(action_tile "Remove"
"(progn
(setq testCpFrom (get_tile \"CopyFrom\"))
(setq testCpTo (get_tile \"CopyTo\"))
(sub-Remove testCpFrom testCpTo)
)"
)
(action_tile "Apply" "(UpdateAttributes)")
(action_tile "Accept"
"(progn
(UpdateAttributes)
(done_dialog 1)
)"
)
(action_tile "Cancel" "(done_dialog 0)")
(start_dialog)
)
)
(command "_.undo" "_end")
(princ)
)


;---------------------------------------------------------------------------

-------
Quote:

(defun ChangeLists (IndexNum / Att2Move)

(setq Att2Move (nth (atoi IndexNum) AttList))
(setq AttList (vl-remove Att2Move AttList))
(if MasterAtt
(progn
(setq ChangeAtts (cons Att2Move ChangeAtts))
(start_list "CopyTo" 3)
(mapcar '(lambda (x) (add_list (vla-get-TagString x))) ChangeAtts)
(end_list)
)
(progn
(setq MasterAtt Att2Move)
(start_list "CopyFrom" 3)
(add_list (vla-get-TagString MasterAtt))
(end_list)
)
)
(start_list "MasterList" 3)
(mapcar '(lambda (x) (add_list (vla-get-TagString x))) AttList)
(end_list)
(start_list "CopyTo" 3)
(mapcar '(lambda (x) (add_list (vla-get-TagString x))) ChangeAtts)
(end_list)
)


;---------------------------------------------------------------------------

-----
Quote:

(defun UpdateAttributes (/ AttValue)

(if MasterAtt
(progn
(setq AttValue (vla-get-TextString MasterAtt))
(foreach item ChangeAtts
(vla-put-TextString item AttValue)
)
(start_list "CopyFrom" 3)
(end_list)
(start_list "copyTo" 3)
(end_list)
(setq MasterAtt nil)
(setq ChangeAtts nil)
)
)
)


;---------------------------------------------------------------------------

------
Quote:

(defun sub-Remove (CpFromVal CpToVal / temp1 cnt1 RmList)

(cond
((and MasterAtt (/= CpFromVal ""))
(setq AttList (cons MasterAtt Attlist))
(start_list "CopyFrom" 3)
(end_list)
(setq MasterAtt nil)
)
((and ChangeAtts (> (length ChangeAtts) 0) (/= CpToVal ""))
(setq RmList (read (strcat "(" CpToVal ")")))
(foreach item RmList
(setq AttList (cons (nth item ChangeAtts) Attlist))
)
(setq cnt1 0)
(while (< cnt1 (length ChangeAtts))
(if (not (member cnt1 RmList))
(setq temp1 (cons (nth cnt1 ChangeAtts) temp1))
)
(setq cnt1 (1+ cnt1))
)
(setq ChangeAtts (reverse temp1))
(if ChangeAtts
(progn
(start_list "CopyTo" 3)
(mapcar '(lambda (x) (add_list (vla-get-TagString x))) ChangeAtts)
(end_list)
)
(progn
(start_list "CopyTo" 3)
(end_list)
)
)
)
)
(setq AttList (vl-sort AttList '(lambda (a b) (< (vla-get-TagString a)
(vla-get-TagString b)))))
(start_list "MasterList" 3)
(mapcar '(lambda (x) (add_list (vla-get-TagString x))) AttList)
(end_list)
)

;------------------------------------------------------------------

(defun tmw:Var->Safe (VariantValue /)

(if (= (type VariantValue) 'variant)
(safearray-value (variant-value VariantValue))
)
)


Back to top
OLD-CADaver
Guest





Posted: Fri Jan 07, 2005 6:35 pm    Post subject: Re: Multiple Identical Attributes in Title Block - too much Reply with quote

What are you're trying to do that GATTE from express tools won't do??
Back to top
Adam Dew
Guest





Posted: Fri Jan 07, 2005 6:44 pm    Post subject: Re: Multiple Identical Attributes in Title Block - too much Reply with quote

I xref my title block info, except for the data which is pertinent only to
that sheet...
Back to top
T.Willey
Guest





Posted: Fri Jan 07, 2005 8:50 pm    Post subject: Re: Multiple Identical Attributes in Title Block - too much Reply with quote

Copy the content of my other post into a new text document. Then save it with an extension of ".lsp". Then you will be able to load it.
Make sure the dcl file is in a folder that is on your search paths within acad.

Tim
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB