pmxcad Posted July 29, 2016 Share Posted July 29, 2016 Hello, question: can i use the ! within a gatte script? I am using the script for attribute fill in the drawing foldername. i just fills in "!d" ; ; TEST ; ; ZOOM ALL ; (setq CurrDwgName (getvar "dwgname")) (setq a (getvar "dwgprefix")) (setq b (getvar "dwgname")) (setq c (strcat a b)) (setq d (vl-filename-directory c)) (setq e (vl-filename-base d)) (setq f (vl-filename-base c)) (setq g (strcat e "-" f)) (setq Fname (substr CurrDwgName 1 (- (strlen CurrDwgName) 4))) (setq name (strcat (getvar "DWGPREFIX") FNAME ".pdf")) gatte block OH-PSD NAME DISCR-02 !d thanks PMXcad Quote Link to comment Share on other sites More sharing options...
BIGAL Posted July 29, 2016 Share Posted July 29, 2016 Why not make all the code a lisp then you would imply d as a lisp variable. (load "xxxxx") (command "gatte" "Block" "OH-PSD" NAME "DISCR-02" d) Quote Link to comment Share on other sites More sharing options...
pmxcad Posted July 30, 2016 Author Share Posted July 30, 2016 I have tried, but gatte wont run in à lisp. I need something like (c:gatte). Because it calls the gatte lisp in à lisp. (Read it on internet). But stil nog working. Pmxcad Quote Link to comment Share on other sites More sharing options...
pmxcad Posted July 30, 2016 Author Share Posted July 30, 2016 Not working, Put it in a script or lisp i get: Command: (command "gatte" "Block" "OH-PSD" NAME "DISCR-02" d) gatte Unknown command "GATTE". Press F1 for help. PmxCAD Quote Link to comment Share on other sites More sharing options...
BIGAL Posted July 31, 2016 Share Posted July 31, 2016 Ok it may be like using extrim in a lisp you must Load it first then you start it with a different command. (load "extrim") (etrim) Quote Link to comment Share on other sites More sharing options...
BIGAL Posted July 31, 2016 Share Posted July 31, 2016 (c:gatte) works try (c:gatte) (command "Block" "OH-PSD" NAME "DISCR-02" d) Quote Link to comment Share on other sites More sharing options...
pmxcad Posted August 1, 2016 Author Share Posted August 1, 2016 Nope, not working. in a sript or lisp. prompt: Command: (c:gatte) Select block or attribute [block name]: (command "Block" "OH-PSD" "NAME" "DISCR-02" d) after (c:gatte) it stops en ask to select and doesnt go on with the script/lisp. PmxCAD Quote Link to comment Share on other sites More sharing options...
BIGAL Posted August 2, 2016 Share Posted August 2, 2016 After a few more goes why not just use a lisp to change the correct attribute value and ignore Gatte. ssget will get the correctblock if you apply a couple of filters if say in a layout the filter can be "paperspace" (setq ss1 (ssget "x" (list (cons 0 "INSERT") (cons 2 bname)(cons 410 tabname)))) (foreach att (vlax-invoke (vlax-ename->vla-object (ssname SS1 0 )) 'getattributes) (if (= tagname (strcase (vla-get-tagstring att))) (vla-put-textstring att newstr) ) ; end if ) ; end foreach Quote Link to comment Share on other sites More sharing options...
tombu Posted August 3, 2016 Share Posted August 3, 2016 Nope, not working. in a sript or lisp. prompt: Command: (c:gatte) Select block or attribute [block name]: (command "Block" "OH-PSD" "NAME" "DISCR-02" d) after (c:gatte) it stops en ask to select and doesnt go on with the script/lisp. PmxCAD Assuming block name is OH-PSD with attribute name NAME you want to read DISCR-02 then this script should work for every insert of that block in the drawing: (load "gatte.lsp")(c:gatte) Block OH-PSD NAME DISCR-02 Yes Couldn't figure out what the d was for. Quote Link to comment Share on other sites More sharing options...
pmxcad Posted August 6, 2016 Author Share Posted August 6, 2016 Hello tombu, the "d'" used in the first post to call the folder name. i mostly use a ! to call the variable in a script but it does not work with GATTE. (load "gatte.lsp")(c:gatte) Block OH-PSD NAME DISCR-02 Yes This works to get gatte working but i cannot use the !d or d to get the variable (folder name) Thanks, PmxCAD 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.