CadFrank Posted August 15, 2014 Share Posted August 15, 2014 Ok so what im trying to do is modify the value of a lookup in the dynamic block "CARTOUCHE LU" which is located in all the layouts. (setq nomBloc "Cartouche LU") (setq obj (vla-get-effectivename Nombloc (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object)) ) ) ) Now it returns ; error: bad argument type: VLA-OBJECT ("CARTOUCHE LU") I don't know why i'd like some explanation please. Would be appreciated. Thanks ! Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 15, 2014 Share Posted August 15, 2014 You must be copy and paste codes from routine to another without understanding where the code goes and what it does . Did not THIS post do the same thing you are trying to do in this post ? Quote Link to comment Share on other sites More sharing options...
CadFrank Posted August 15, 2014 Author Share Posted August 15, 2014 Well it's not exactly the same thing. Before I wanted to change an attribut text now it's a lookup in my dynamic block. The thing is I'd like to understand. But I would need explanation from the code poeple give me sometimes would help me understand Some people do help me out like you and some just post and it does work but I don't know why hehe! And it's not like i'm not ready on the subject I have a bunch of Autodesk PDF talking about it and I find them hard to understand. It might just not be explained in a way I get things. So there it is Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 15, 2014 Share Posted August 15, 2014 What are you trying to do ? Quote Link to comment Share on other sites More sharing options...
CadFrank Posted August 15, 2014 Author Share Posted August 15, 2014 Well from the same Block I have in the drawing you got from the other post. I want to change the Lookup 1 accord to the revision. Now I had it working when I passed it in the old version : (vlax-for lt (vla-get-layouts adoc) ;(vla-put-activelayout adoc lt) ; optionnel (vlax-for obj (vla-get-block lt) (if (and (= "AcDbBlockReference" (vla-get-objectname obj)) (member (vla-get-effectivename obj) Nombloc) (= :vlax-true (vla-get-hasattributes obj) )) (progn (setq atts (vlax-invoke obj 'getattributes)) (foreach x atts (if (= Tag#Pg (vla-get-tagstring x)) (vla-put-textstring x Tnumtabs) ) (setq N-E-dbp (nth 2 (vlax-invoke obj 'GetDynamicBlockProperties))) (vla-put-value N-E-dbp TRev) ) ) ) ) ) but now it's not getting the VLA-Object from the other code. So when I passe this code : Now my code is this and it doesn't work (defun _Revision (/ TRev TDesc Tdate TPar TApp TagRev TagNRev TagDesc TagDat TagPar TagApp lt obj atts x DynBP) ;| Élénment de text |; (if (= choix "N") (setq TRev "0")) (if (= choix "R") (setq TRev (itoa (fix (getreal "\n Numéro de révision : "))))) (setq TDesc (strcase (getstring T "\n Donner la raison de la révision. : ")) Tdate (_Today) ) (initget 1 "C F J S") (setq TPar (getkword "\n Qui a fait les changements sur le plan? [Charle/François/Julieta/Simon]: ")) (if (= TPar "C")(setq TPar "C.L")) (if (= TPar "F")(Setq TPar "F.L")) (if (= TPar "J")(setq TPar "J.L")) (if (= TPar "S")(setq TPar "S.D")) (initget 1 "J S") (setq TApp (getkword "\n Qui a approuvé les changement [Julieta/Simon]: ")) (if (= TApp "J")(setq TApp "J.L")) (if (= TApp "S")(setq TApp "S.D")) ;| Élénment des TAG |; (setq TagRev "REV" TagNRev (strcat "N°REV" TRev) TagDesc (strcat "DESCRITION" TRev) TagDat (strcat "DATE" TRev) TagPar (strcat "PAR" TRev) TagApp (strcat "APP" TRev) ) ;Inscrit le texte dans chacun des attributs (mapcar '_Text->Attribute->Layout (list TagRev TagNRev TagDesc TagDat TagPar TagApp) (list TRev TRev TDesc Tdate TPar TApp) ) ) Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted August 16, 2014 Share Posted August 16, 2014 but now it's not getting the VLA-Object from the other code. missing? (vl-load-com) (setq adoc (vla-get-activedocument(vlax-get-acad-object))) Quote Link to comment Share on other sites More sharing options...
CadFrank Posted August 16, 2014 Author Share Posted August 16, 2014 missing? (vl-load-com) (setq adoc (vla-get-activedocument(vlax-get-acad-object))) Thanks for the help buts it's in the first comment I'd like to know what's missing and a little explanation on how to get there. Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted August 16, 2014 Share Posted August 16, 2014 Thanks for the help buts it's in the first comment I'd like to know what's missing and a little explanation on how to get there. i'm not tutor, just share my understanding (so i hope senior can advise if i'm wrong thanx) vb activex is like "explorer expand tree" sequence... assume application is "my computer", so we must expend valid path "directories" & "sub-folder" to reach what we are looking for other eg: layouts etc.. (vla-get-layouts adoc) ?? --> ?? --> layouts, missing path is adoc= documents & application(object) (setq adoc (vla-get-activedocument(vlax-get-acad-object))) ; Quote Link to comment Share on other sites More sharing options...
CadFrank Posted August 18, 2014 Author Share Posted August 18, 2014 i'm not tutor, just share my understanding (so i hope senior can advise if i'm wrong thanx) Well I understand that far. Where I get mixed up is when I need to change a value. How do I process to knowing what function is to be used. Even if I use "vla-get-block" it won't get the block needed. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.