Jump to content

the use if ! in gatte script


Recommended Posts

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

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...