filenames

Discussion in 'AutoCAD' started by spencer1971, Jun 9, 2004.

  1. spencer1971

    spencer1971 Guest

    Could someone please tell me why line 4 below is not removing the (.dwg) suffix from dname.. I cant see what i'm doing wrong and im sure its something silly.

    (Defun c:ext (/)
    (setq sheetno (getstring "\nsheet number?: "))
    (setq dname (getvar "dwgname"))
    (substr dname 1 (- (strlen dname) 4))
    (setq dpref (getvar "dwgprefix"))
    (setq fname (strcat dpref dname " - " sheetno))
    (setq pt1 (getpoint "\npick left hatd corner of sheet?: "))
    (setq ss1 (ssget))
    (command "-wblock" fname "" pt1 ss1 "")
    )

    thanks

    Spencer
     
    spencer1971, Jun 9, 2004
    #1
  2. spencer1971

    NParcon Guest

    Change this line:
    (substr dname 1 (- (strlen dname) 4))

    to this one:
    (setq dname (substr dname 1 (- (strlen dname) 4)))
     
    NParcon, Jun 9, 2004
    #2
  3. spencer1971

    spencer1971 Guest

    Not to worry,, I was being dumb, ive worked it out for myself.. Duhh
     
    spencer1971, Jun 9, 2004
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.