Autodesk Technology Managers Forum
Share your knowledge, ask questions, and engage with fellow CAD/BIM Managers.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 9
Anonymous
435 Views, 8 Replies

Drawing Manager ??

We are currently looking for a program or software that will automatically
update a drawing's revision. Then move the older drawing to an archive
directory, or change the revision letter in the drawing name. Any
suggestions would be greatly appreciated.

--
John Laidler
Cad Manager
Duckworth & Associates, Inc.
(734) 455-7500
8 REPLIES 8
Message 2 of 9
Anonymous
in reply to: Anonymous

Only as part of a large document management app.

--
Stuart Nathan @
http://www.dwgoffice.com
Message 3 of 9
Anonymous
in reply to: Anonymous

It sounds simple enough. If your using R2000 or R2000i I may be able to
help you out. Do you want a command to perform this each time they open a
drawing or just when they run the command. Also, are all of the drawings
R2000 with the dwgprops tracking the revisions?

--
Rodney McManamy
President
MACSolids
Maximizing AutoCAD Solids
rmcmanamy@macsolids.com
"John Laidler" wrote in message
news:4EFB32A9DC86A5DC4CB7DDA9CD170C9E@in.WebX.maYIadrTaRb...
> We are currently looking for a program or software that will automatically
> update a drawing's revision. Then move the older drawing to an archive
> directory, or change the revision letter in the drawing name. Any
> suggestions would be greatly appreciated.
>
> --
> John Laidler
> Cad Manager
> Duckworth & Associates, Inc.
> (734) 455-7500
>
Message 4 of 9
Anonymous
in reply to: Anonymous

We're using A2Ki, but saving as R14.
The command shouldn't perform each time the drawing is opened, rather it
should perform when prompted.

"Rodney McManamy" wrote in message
news:53D0DAC15352A720CA1A71A725EE7B14@in.WebX.maYIadrTaRb...
> It sounds simple enough. If your using R2000 or R2000i I may be able to
> help you out. Do you want a command to perform this each time they open a
> drawing or just when they run the command. Also, are all of the drawings
> R2000 with the dwgprops tracking the revisions?
>
> --
> Rodney McManamy
> President
> MACSolids
> Maximizing AutoCAD Solids
> rmcmanamy@macsolids.com
> "John Laidler" wrote in message
> news:4EFB32A9DC86A5DC4CB7DDA9CD170C9E@in.WebX.maYIadrTaRb...
> > We are currently looking for a program or software that will
automatically
> > update a drawing's revision. Then move the older drawing to an archive
> > directory, or change the revision letter in the drawing name. Any
> > suggestions would be greatly appreciated.
> >
> > --
> > John Laidler
> > Cad Manager
> > Duckworth & Associates, Inc.
> > (734) 455-7500
> >
>
Message 5 of 9
Anonymous
in reply to: Anonymous

I don't think that R14 supported the dwgprops so I'm guessing that you would
be appending the revised drawing name.
Drawing-A.dwg -> Drawing-B.dwg

This is quick and dirty, no error checking involved bu will look for a
drawing revision at the end of the filename -A. If no revision is found
then it will create the -A revision. It will also attempt to create an
Old_Drawings subdirectory and move the old file over. It also saveas the
new drawing as the R14 dwg type for you. Help it helps but I haven't had my
morning coffee yet so I don't give any warranties. But it worked on my
NT4.0 and AutoCAD 2000i.

(defun c:revision (/ mac_acadapp mac_acaddoc
mac_acaddoc_name mac_acaddoc_basename mac_acaddoc_path
mac_acaddoc_fullname mac_oldrevision mac_acaddoc_basename
mac_newrevision mac_acaddoc_newname mac_acaddoc_newpath
mac_acaddoc_newfullname
)
(vl-load-com)
(setq mac_acadapp (vlax-get-acad-object)
mac_acaddoc (vlax-get-property mac_acadapp 'activedocument)
mac_acaddoc_name (vlax-get-property mac_acaddoc 'name)
mac_acaddoc_basename (vl-filename-base mac_acaddoc_name)
mac_acaddoc_path (vlax-get-property mac_acaddoc 'path)
mac_acaddoc_fullname (vlax-get-property mac_acaddoc 'fullname)
)
;; Determine if a drawing revision already exists as a letter
(if (wcmatch mac_acaddoc_basename "*-@")
(setq mac_oldrevision (strcase (substr mac_acaddoc_basename (strlen
mac_acaddoc_basename)))
mac_acaddoc_basename (substr mac_acaddoc_basename 1 (- (strlen
mac_acaddoc_basename) 2))
mac_newrevision (chr (+ (ascii mac_oldrevision) 1))
)
(setq mac_newrevision "A")
)
(setq mac_acaddoc_newname (strcat mac_acaddoc_path "\\"
mac_acaddoc_basename
"-" mac_newrevision ".dwg"
)
)
(vlax-invoke-method mac_acaddoc 'saveas mac_acaddoc_newname acr14_dwg)
;; Verify that the drawing was actually saved
(if (= (strcase (vl-filename-base mac_acaddoc_newname))
(strcase (vl-filename-base (vlax-get-property mac_acaddoc 'name)))
)
(progn
(alert (strcat "Drawing was saved as a new revision:\n"
mac_acaddoc_newname))
;; Move the old drawing to an Old_Drawings Directory
(setq mac_acaddoc_newpath (strcat mac_acaddoc_path
"\\Old_Drawings")
mac_acaddoc_newfullname (strcat mac_acaddoc_newpath "\\"
mac_acaddoc_name)
)
;; Verify that the directory exists or create it
(if (= (vl-directory-files mac_acaddoc_newpath nil) nil)
(vl-mkdir mac_acaddoc_newpath)
)
(if (vl-directory-files mac_acaddoc_newpath nil)
;; Check if a drawing already exists in the Old_Drawings Directory
(if (findfile mac_acaddoc_newfullname)
(alert
(strcat "An existing file with the same name was\nfound in the
following directory:\n"
mac_acaddoc_newpath
"\nThe old drawing cannot be moved over to this directory."
)
)
;; No existing drawing was found so try to copy the old drawing over
(if (vl-file-copy mac_acaddoc_fullname mac_acaddoc_newfullname)
(if (vl-file-delete mac_acaddoc_fullname)
(alert
(strcat "The old drawing was moved over to this directory:\n"
mac_acaddoc_newpath)
)
(alert (strcat "The old drawing was copied over to this directory:\n"
mac_acaddoc_newpath
"\nBut it could not be deleted from the original directory."
)
)
)
(alert (strcat "The old drawing could not be copied to the following
directory:\n"
mac_acaddoc_newpath
)
)
)
)
(alert (strcat "The following directory could not be created:"
mac_acaddoc_newpath
"\nThe old drawing cannot be moved over to this directory."
)
)
)
)
(alert "An error occurred and the drawing was\nnot saved as a new
revision")
)
(princ)
)

--
Rodney McManamy
President
MACSolids
Maximizing AutoCAD Solids
rmcmanamy@macsolids.com
"John Laidler" wrote in message
news:DB752E1A197C4A46CA3FC6695ED7129A@in.WebX.maYIadrTaRb...
> We're using A2Ki, but saving as R14.
> The command shouldn't perform each time the drawing is opened, rather it
> should perform when prompted.
>
> "Rodney McManamy" wrote in message
> news:53D0DAC15352A720CA1A71A725EE7B14@in.WebX.maYIadrTaRb...
> > It sounds simple enough. If your using R2000 or R2000i I may be able to
> > help you out. Do you want a command to perform this each time they open
a
> > drawing or just when they run the command. Also, are all of the
drawings
> > R2000 with the dwgprops tracking the revisions?
> >
> > --
> > Rodney McManamy
> > President
> > MACSolids
> > Maximizing AutoCAD Solids
> > rmcmanamy@macsolids.com
> > "John Laidler" wrote in message
> > news:4EFB32A9DC86A5DC4CB7DDA9CD170C9E@in.WebX.maYIadrTaRb...
> > > We are currently looking for a program or software that will
> automatically
> > > update a drawing's revision. Then move the older drawing to an
archive
> > > directory, or change the revision letter in the drawing name. Any
> > > suggestions would be greatly appreciated.
> > >
> > > --
> > > John Laidler
> > > Cad Manager
> > > Duckworth & Associates, Inc.
> > > (734) 455-7500
> > >
> >
>
Message 6 of 9
Anonymous
in reply to: Anonymous

Thank you, it works perfectly.

"Rodney McManamy" wrote in message
news:82EEED6578AE334073E886A60CE531DC@in.WebX.maYIadrTaRb...
> I don't think that R14 supported the dwgprops so I'm guessing that you
would
> be appending the revised drawing name.
> Drawing-A.dwg -> Drawing-B.dwg
>
> This is quick and dirty, no error checking involved bu will look for a
> drawing revision at the end of the filename -A. If no revision is found
> then it will create the -A revision. It will also attempt to create an
> Old_Drawings subdirectory and move the old file over. It also saveas the
> new drawing as the R14 dwg type for you. Help it helps but I haven't had
my
> morning coffee yet so I don't give any warranties. But it worked on my
> NT4.0 and AutoCAD 2000i.
>
> (defun c:revision (/ mac_acadapp mac_acaddoc
> mac_acaddoc_name mac_acaddoc_basename mac_acaddoc_path
> mac_acaddoc_fullname mac_oldrevision mac_acaddoc_basename
> mac_newrevision mac_acaddoc_newname mac_acaddoc_newpath
> mac_acaddoc_newfullname
> )
> (vl-load-com)
> (setq mac_acadapp (vlax-get-acad-object)
> mac_acaddoc (vlax-get-property mac_acadapp 'activedocument)
> mac_acaddoc_name (vlax-get-property mac_acaddoc 'name)
> mac_acaddoc_basename (vl-filename-base mac_acaddoc_name)
> mac_acaddoc_path (vlax-get-property mac_acaddoc 'path)
> mac_acaddoc_fullname (vlax-get-property mac_acaddoc 'fullname)
> )
> ;; Determine if a drawing revision already exists as a letter
> (if (wcmatch mac_acaddoc_basename "*-@")
> (setq mac_oldrevision (strcase (substr mac_acaddoc_basename
(strlen
> mac_acaddoc_basename)))
> mac_acaddoc_basename (substr mac_acaddoc_basename 1 (- (strlen
> mac_acaddoc_basename) 2))
> mac_newrevision (chr (+ (ascii mac_oldrevision) 1))
> )
> (setq mac_newrevision "A")
> )
> (setq mac_acaddoc_newname (strcat mac_acaddoc_path "\\"
> mac_acaddoc_basename
> "-" mac_newrevision ".dwg"
> )
> )
> (vlax-invoke-method mac_acaddoc 'saveas mac_acaddoc_newname acr14_dwg)
> ;; Verify that the drawing was actually saved
> (if (= (strcase (vl-filename-base mac_acaddoc_newname))
> (strcase (vl-filename-base (vlax-get-property mac_acaddoc 'name)))
> )
> (progn
> (alert (strcat "Drawing was saved as a new revision:\n"
> mac_acaddoc_newname))
> ;; Move the old drawing to an Old_Drawings Directory
> (setq mac_acaddoc_newpath (strcat mac_acaddoc_path
> "\\Old_Drawings")
> mac_acaddoc_newfullname (strcat mac_acaddoc_newpath "\\"
> mac_acaddoc_name)
> )
> ;; Verify that the directory exists or create it
> (if (= (vl-directory-files mac_acaddoc_newpath nil) nil)
> (vl-mkdir mac_acaddoc_newpath)
> )
> (if (vl-directory-files mac_acaddoc_newpath nil)
> ;; Check if a drawing already exists in the Old_Drawings Directory
> (if (findfile mac_acaddoc_newfullname)
> (alert
> (strcat "An existing file with the same name was\nfound in the
> following directory:\n"
> mac_acaddoc_newpath
> "\nThe old drawing cannot be moved over to this directory."
> )
> )
> ;; No existing drawing was found so try to copy the old drawing over
> (if (vl-file-copy mac_acaddoc_fullname mac_acaddoc_newfullname)
> (if (vl-file-delete mac_acaddoc_fullname)
> (alert
> (strcat "The old drawing was moved over to this directory:\n"
> mac_acaddoc_newpath)
> )
> (alert (strcat "The old drawing was copied over to this
directory:\n"
> mac_acaddoc_newpath
> "\nBut it could not be deleted from the original directory."
> )
> )
> )
> (alert (strcat "The old drawing could not be copied to the following
> directory:\n"
> mac_acaddoc_newpath
> )
> )
> )
> )
> (alert (strcat "The following directory could not be created:"
> mac_acaddoc_newpath
> "\nThe old drawing cannot be moved over to this directory."
> )
> )
> )
> )
> (alert "An error occurred and the drawing was\nnot saved as a new
> revision")
> )
> (princ)
> )
>
> --
> Rodney McManamy
> President
> MACSolids
> Maximizing AutoCAD Solids
> rmcmanamy@macsolids.com
> "John Laidler" wrote in message
> news:DB752E1A197C4A46CA3FC6695ED7129A@in.WebX.maYIadrTaRb...
> > We're using A2Ki, but saving as R14.
> > The command shouldn't perform each time the drawing is opened, rather it
> > should perform when prompted.
> >
> > "Rodney McManamy" wrote in message
> > news:53D0DAC15352A720CA1A71A725EE7B14@in.WebX.maYIadrTaRb...
> > > It sounds simple enough. If your using R2000 or R2000i I may be able
to
> > > help you out. Do you want a command to perform this each time they
open
> a
> > > drawing or just when they run the command. Also, are all of the
> drawings
> > > R2000 with the dwgprops tracking the revisions?
> > >
> > > --
> > > Rodney McManamy
> > > President
> > > MACSolids
> > > Maximizing AutoCAD Solids
> > > rmcmanamy@macsolids.com
> > > "John Laidler" wrote in message
> > > news:4EFB32A9DC86A5DC4CB7DDA9CD170C9E@in.WebX.maYIadrTaRb...
> > > > We are currently looking for a program or software that will
> > automatically
> > > > update a drawing's revision. Then move the older drawing to an
> archive
> > > > directory, or change the revision letter in the drawing name. Any
> > > > suggestions would be greatly appreciated.
> > > >
> > > > --
> > > > John Laidler
> > > > Cad Manager
> > > > Duckworth & Associates, Inc.
> > > > (734) 455-7500
> > > >
> > >
> >
>
Message 7 of 9
Anonymous
in reply to: Anonymous

one problem I just found though...
why won't it move the original file to Old_ Drawings.
It seems to always want 2 versions of the same drawing.

"Rodney McManamy" wrote in message
news:82EEED6578AE334073E886A60CE531DC@in.WebX.maYIadrTaRb...
> I don't think that R14 supported the dwgprops so I'm guessing that you
would
> be appending the revised drawing name.
> Drawing-A.dwg -> Drawing-B.dwg
>
> This is quick and dirty, no error checking involved bu will look for a
> drawing revision at the end of the filename -A. If no revision is found
> then it will create the -A revision. It will also attempt to create an
> Old_Drawings subdirectory and move the old file over. It also saveas the
> new drawing as the R14 dwg type for you. Help it helps but I haven't had
my
> morning coffee yet so I don't give any warranties. But it worked on my
> NT4.0 and AutoCAD 2000i.
>
> (defun c:revision (/ mac_acadapp mac_acaddoc
> mac_acaddoc_name mac_acaddoc_basename mac_acaddoc_path
> mac_acaddoc_fullname mac_oldrevision mac_acaddoc_basename
> mac_newrevision mac_acaddoc_newname mac_acaddoc_newpath
> mac_acaddoc_newfullname
> )
> (vl-load-com)
> (setq mac_acadapp (vlax-get-acad-object)
> mac_acaddoc (vlax-get-property mac_acadapp 'activedocument)
> mac_acaddoc_name (vlax-get-property mac_acaddoc 'name)
> mac_acaddoc_basename (vl-filename-base mac_acaddoc_name)
> mac_acaddoc_path (vlax-get-property mac_acaddoc 'path)
> mac_acaddoc_fullname (vlax-get-property mac_acaddoc 'fullname)
> )
> ;; Determine if a drawing revision already exists as a letter
> (if (wcmatch mac_acaddoc_basename "*-@")
> (setq mac_oldrevision (strcase (substr mac_acaddoc_basename
(strlen
> mac_acaddoc_basename)))
> mac_acaddoc_basename (substr mac_acaddoc_basename 1 (- (strlen
> mac_acaddoc_basename) 2))
> mac_newrevision (chr (+ (ascii mac_oldrevision) 1))
> )
> (setq mac_newrevision "A")
> )
> (setq mac_acaddoc_newname (strcat mac_acaddoc_path "\\"
> mac_acaddoc_basename
> "-" mac_newrevision ".dwg"
> )
> )
> (vlax-invoke-method mac_acaddoc 'saveas mac_acaddoc_newname acr14_dwg)
> ;; Verify that the drawing was actually saved
> (if (= (strcase (vl-filename-base mac_acaddoc_newname))
> (strcase (vl-filename-base (vlax-get-property mac_acaddoc 'name)))
> )
> (progn
> (alert (strcat "Drawing was saved as a new revision:\n"
> mac_acaddoc_newname))
> ;; Move the old drawing to an Old_Drawings Directory
> (setq mac_acaddoc_newpath (strcat mac_acaddoc_path
> "\\Old_Drawings")
> mac_acaddoc_newfullname (strcat mac_acaddoc_newpath "\\"
> mac_acaddoc_name)
> )
> ;; Verify that the directory exists or create it
> (if (= (vl-directory-files mac_acaddoc_newpath nil) nil)
> (vl-mkdir mac_acaddoc_newpath)
> )
> (if (vl-directory-files mac_acaddoc_newpath nil)
> ;; Check if a drawing already exists in the Old_Drawings Directory
> (if (findfile mac_acaddoc_newfullname)
> (alert
> (strcat "An existing file with the same name was\nfound in the
> following directory:\n"
> mac_acaddoc_newpath
> "\nThe old drawing cannot be moved over to this directory."
> )
> )
> ;; No existing drawing was found so try to copy the old drawing over
> (if (vl-file-copy mac_acaddoc_fullname mac_acaddoc_newfullname)
> (if (vl-file-delete mac_acaddoc_fullname)
> (alert
> (strcat "The old drawing was moved over to this directory:\n"
> mac_acaddoc_newpath)
> )
> (alert (strcat "The old drawing was copied over to this
directory:\n"
> mac_acaddoc_newpath
> "\nBut it could not be deleted from the original directory."
> )
> )
> )
> (alert (strcat "The old drawing could not be copied to the following
> directory:\n"
> mac_acaddoc_newpath
> )
> )
> )
> )
> (alert (strcat "The following directory could not be created:"
> mac_acaddoc_newpath
> "\nThe old drawing cannot be moved over to this directory."
> )
> )
> )
> )
> (alert "An error occurred and the drawing was\nnot saved as a new
> revision")
> )
> (princ)
> )
>
> --
> Rodney McManamy
> President
> MACSolids
> Maximizing AutoCAD Solids
> rmcmanamy@macsolids.com
> "John Laidler" wrote in message
> news:DB752E1A197C4A46CA3FC6695ED7129A@in.WebX.maYIadrTaRb...
> > We're using A2Ki, but saving as R14.
> > The command shouldn't perform each time the drawing is opened, rather it
> > should perform when prompted.
> >
> > "Rodney McManamy" wrote in message
> > news:53D0DAC15352A720CA1A71A725EE7B14@in.WebX.maYIadrTaRb...
> > > It sounds simple enough. If your using R2000 or R2000i I may be able
to
> > > help you out. Do you want a command to perform this each time they
open
> a
> > > drawing or just when they run the command. Also, are all of the
> drawings
> > > R2000 with the dwgprops tracking the revisions?
> > >
> > > --
> > > Rodney McManamy
> > > President
> > > MACSolids
> > > Maximizing AutoCAD Solids
> > > rmcmanamy@macsolids.com
> > > "John Laidler" wrote in message
> > > news:4EFB32A9DC86A5DC4CB7DDA9CD170C9E@in.WebX.maYIadrTaRb...
> > > > We are currently looking for a program or software that will
> > automatically
> > > > update a drawing's revision. Then move the older drawing to an
> archive
> > > > directory, or change the revision letter in the drawing name. Any
> > > > suggestions would be greatly appreciated.
> > > >
> > > > --
> > > > John Laidler
> > > > Cad Manager
> > > > Duckworth & Associates, Inc.
> > > > (734) 455-7500
> > > >
> > >
> >
>
Message 8 of 9
Anonymous
in reply to: Anonymous

Sorry, I forgot to release the drawing in the first example. this one
should work better.
(defun c:revision (/ mac_acadapp mac_acaddoc
mac_acaddoc_name mac_acaddoc_basename mac_acaddoc_path
mac_acaddoc_fullname mac_oldrevision mac_acaddoc_basename
mac_newrevision mac_acaddoc_newname mac_acaddoc_newpath
mac_acaddoc_newfullname
)
(vl-load-com)
(setq mac_acadapp (vlax-get-acad-object)
mac_acaddoc (vlax-get-property mac_acadapp 'activedocument)
mac_acaddoc_name (vlax-get-property mac_acaddoc 'name)
mac_acaddoc_basename (vl-filename-base mac_acaddoc_name)
mac_acaddoc_path (vlax-get-property mac_acaddoc 'path)
mac_acaddoc_fullname (vlax-get-property mac_acaddoc 'fullname)
)
;; Determine if a drawing revision already exists as a letter
(if (wcmatch mac_acaddoc_basename "*-@")
(setq mac_oldrevision (strcase (substr mac_acaddoc_basename (strlen
mac_acaddoc_basename)))
mac_acaddoc_basename (substr mac_acaddoc_basename 1 (- (strlen
mac_acaddoc_basename) 2))
mac_newrevision (chr (+ (ascii mac_oldrevision) 1))
)
(setq mac_newrevision "A")
)
(setq mac_acaddoc_newname (strcat mac_acaddoc_path "\\"
mac_acaddoc_basename
"-" mac_newrevision ".dwg"
)
)
(vlax-invoke-method mac_acaddoc 'saveas mac_acaddoc_newname acr14_dwg)
;; Verify that the drawing was actually saved
(if (= (strcase (vl-filename-base mac_acaddoc_newname))
(strcase (vl-filename-base (vlax-get-property mac_acaddoc 'name)))
)
(progn
(alert (strcat "Drawing was saved as a new revision:\n"
mac_acaddoc_newname))
;; Release the old drawing
(vlax-release-object mac_acaddoc)
(vlax-release-object mac_acadapp)
;; Move the old drawing to an Old_Drawings Directory
(setq mac_acaddoc_newpath (strcat mac_acaddoc_path
"\\Old_Drawings")
mac_acaddoc_newfullname (strcat mac_acaddoc_newpath "\\"
mac_acaddoc_name)
)
;; Verify that the directory exists or create it
(if (= (vl-directory-files mac_acaddoc_newpath nil) nil)
(vl-mkdir mac_acaddoc_newpath)
)
(if (vl-directory-files mac_acaddoc_newpath nil)
;; Check if a drawing already exists in the Old_Drawings Directory
(if (findfile mac_acaddoc_newfullname)
(alert
(strcat "An existing file with the same name was\nfound in the
following directory:\n"
mac_acaddoc_newpath
"\nThe old drawing cannot be moved over to this directory."
)
)
;; No existing drawing was found so try to copy the old drawing over
(if (vl-file-copy mac_acaddoc_fullname mac_acaddoc_newfullname)
(if (vl-file-delete mac_acaddoc_fullname)
(alert
(strcat "The old drawing was moved over to this directory:\n"
mac_acaddoc_newpath)
)
(alert (strcat "The old drawing was copied over to this directory:\n"
mac_acaddoc_newpath
"\nBut it could not be deleted from the original directory."
)
)
)
(alert (strcat "The old drawing could not be copied to the following
directory:\n"
mac_acaddoc_newpath
)
)
)
)
(alert (strcat "The following directory could not be created:"
mac_acaddoc_newpath
"\nThe old drawing cannot be moved over to this directory."
)
)
)
)
(alert "An error occurred and the drawing was\nnot saved as a new
revision")
)
(princ)
)

--
Rodney McManamy
President
MACSolids
Maximizing AutoCAD Solids
rmcmanamy@macsolids.com
"Rodney McManamy" wrote in message
news:82EEED6578AE334073E886A60CE531DC@in.WebX.maYIadrTaRb...
> I don't think that R14 supported the dwgprops so I'm guessing that you
would
> be appending the revised drawing name.
> Drawing-A.dwg -> Drawing-B.dwg
>
> This is quick and dirty, no error checking involved bu will look for a
> drawing revision at the end of the filename -A. If no revision is found
> then it will create the -A revision. It will also attempt to create an
> Old_Drawings subdirectory and move the old file over. It also saveas the
> new drawing as the R14 dwg type for you. Help it helps but I haven't had
my
> morning coffee yet so I don't give any warranties. But it worked on my
> NT4.0 and AutoCAD 2000i.
>
> (defun c:revision (/ mac_acadapp mac_acaddoc
> mac_acaddoc_name mac_acaddoc_basename mac_acaddoc_path
> mac_acaddoc_fullname mac_oldrevision mac_acaddoc_basename
> mac_newrevision mac_acaddoc_newname mac_acaddoc_newpath
> mac_acaddoc_newfullname
> )
> (vl-load-com)
> (setq mac_acadapp (vlax-get-acad-object)
> mac_acaddoc (vlax-get-property mac_acadapp 'activedocument)
> mac_acaddoc_name (vlax-get-property mac_acaddoc 'name)
> mac_acaddoc_basename (vl-filename-base mac_acaddoc_name)
> mac_acaddoc_path (vlax-get-property mac_acaddoc 'path)
> mac_acaddoc_fullname (vlax-get-property mac_acaddoc 'fullname)
> )
> ;; Determine if a drawing revision already exists as a letter
> (if (wcmatch mac_acaddoc_basename "*-@")
> (setq mac_oldrevision (strcase (substr mac_acaddoc_basename
(strlen
> mac_acaddoc_basename)))
> mac_acaddoc_basename (substr mac_acaddoc_basename 1 (- (strlen
> mac_acaddoc_basename) 2))
> mac_newrevision (chr (+ (ascii mac_oldrevision) 1))
> )
> (setq mac_newrevision "A")
> )
> (setq mac_acaddoc_newname (strcat mac_acaddoc_path "\\"
> mac_acaddoc_basename
> "-" mac_newrevision ".dwg"
> )
> )
> (vlax-invoke-method mac_acaddoc 'saveas mac_acaddoc_newname acr14_dwg)
> ;; Verify that the drawing was actually saved
> (if (= (strcase (vl-filename-base mac_acaddoc_newname))
> (strcase (vl-filename-base (vlax-get-property mac_acaddoc 'name)))
> )
> (progn
> (alert (strcat "Drawing was saved as a new revision:\n"
> mac_acaddoc_newname))
> ;; Move the old drawing to an Old_Drawings Directory
> (setq mac_acaddoc_newpath (strcat mac_acaddoc_path
> "\\Old_Drawings")
> mac_acaddoc_newfullname (strcat mac_acaddoc_newpath "\\"
> mac_acaddoc_name)
> )
> ;; Verify that the directory exists or create it
> (if (= (vl-directory-files mac_acaddoc_newpath nil) nil)
> (vl-mkdir mac_acaddoc_newpath)
> )
> (if (vl-directory-files mac_acaddoc_newpath nil)
> ;; Check if a drawing already exists in the Old_Drawings Directory
> (if (findfile mac_acaddoc_newfullname)
> (alert
> (strcat "An existing file with the same name was\nfound in the
> following directory:\n"
> mac_acaddoc_newpath
> "\nThe old drawing cannot be moved over to this directory."
> )
> )
> ;; No existing drawing was found so try to copy the old drawing over
> (if (vl-file-copy mac_acaddoc_fullname mac_acaddoc_newfullname)
> (if (vl-file-delete mac_acaddoc_fullname)
> (alert
> (strcat "The old drawing was moved over to this directory:\n"
> mac_acaddoc_newpath)
> )
> (alert (strcat "The old drawing was copied over to this
directory:\n"
> mac_acaddoc_newpath
> "\nBut it could not be deleted from the original directory."
> )
> )
> )
> (alert (strcat "The old drawing could not be copied to the following
> directory:\n"
> mac_acaddoc_newpath
> )
> )
> )
> )
> (alert (strcat "The following directory could not be created:"
> mac_acaddoc_newpath
> "\nThe old drawing cannot be moved over to this directory."
> )
> )
> )
> )
> (alert "An error occurred and the drawing was\nnot saved as a new
> revision")
> )
> (princ)
> )
>
> --
> Rodney McManamy
> President
> MACSolids
> Maximizing AutoCAD Solids
> rmcmanamy@macsolids.com
> "John Laidler" wrote in message
> news:DB752E1A197C4A46CA3FC6695ED7129A@in.WebX.maYIadrTaRb...
> > We're using A2Ki, but saving as R14.
> > The command shouldn't perform each time the drawing is opened, rather it
> > should perform when prompted.
> >
> > "Rodney McManamy" wrote in message
> > news:53D0DAC15352A720CA1A71A725EE7B14@in.WebX.maYIadrTaRb...
> > > It sounds simple enough. If your using R2000 or R2000i I may be able
to
> > > help you out. Do you want a command to perform this each time they
open
> a
> > > drawing or just when they run the command. Also, are all of the
> drawings
> > > R2000 with the dwgprops tracking the revisions?
> > >
> > > --
> > > Rodney McManamy
> > > President
> > > MACSolids
> > > Maximizing AutoCAD Solids
> > > rmcmanamy@macsolids.com
> > > "John Laidler" wrote in message
> > > news:4EFB32A9DC86A5DC4CB7DDA9CD170C9E@in.WebX.maYIadrTaRb...
> > > > We are currently looking for a program or software that will
> > automatically
> > > > update a drawing's revision. Then move the older drawing to an
> archive
> > > > directory, or change the revision letter in the drawing name. Any
> > > > suggestions would be greatly appreciated.
> > > >
> > > > --
> > > > John Laidler
> > > > Cad Manager
> > > > Duckworth & Associates, Inc.
> > > > (734) 455-7500
> > > >
> > >
> >
>
Message 9 of 9
Anonymous
in reply to: Anonymous

Let's try this one more time. For some reason AutoCAD will not allow the
drawing to be deleted unless we use the saveas method twice on the new
drawing name? No idea why but it appears to work now.

(defun c:revision (/ mac_acadapp mac_acaddoc
mac_acaddoc_name mac_acaddoc_basename mac_acaddoc_path
mac_acaddoc_fullname mac_oldrevision mac_acaddoc_basename
mac_newrevision mac_acaddoc_newname mac_acaddoc_newpath
mac_acaddoc_newfullname
)
(vl-load-com)
(setq mac_acadapp (vlax-get-acad-object)
mac_acaddoc (vlax-get-property mac_acadapp 'activedocument)
mac_acaddoc_name (vlax-get-property mac_acaddoc 'name)
mac_acaddoc_basename (vl-filename-base mac_acaddoc_name)
mac_acaddoc_path (vlax-get-property mac_acaddoc 'path)
mac_acaddoc_fullname (vlax-get-property mac_acaddoc 'fullname)
mac_acaddoc_backupfullname (strcat mac_acaddoc_path "\\"
mac_acaddoc_basename ".bak")
)
;; Determine if a drawing revision already exists as a letter
(if (wcmatch mac_acaddoc_basename "*-@")
(setq mac_oldrevision (strcase (substr mac_acaddoc_basename (strlen
mac_acaddoc_basename)))
mac_acaddoc_basename (substr mac_acaddoc_basename 1 (- (strlen
mac_acaddoc_basename) 2))
mac_newrevision (chr (+ (ascii mac_oldrevision) 1))
)
(setq mac_newrevision "A")
)
(setq mac_acaddoc_newname (strcat mac_acaddoc_path "\\"
mac_acaddoc_basename
"-" mac_newrevision ".dwg"
)
)
(vlax-invoke-method mac_acaddoc 'saveas mac_acaddoc_newname acr14_dwg)
;; Verify that the drawing was actually saved
(if (= (strcase (vl-filename-base mac_acaddoc_newname))
(strcase (vl-filename-base (vlax-get-property mac_acaddoc 'name)))
)
(progn
(vlax-invoke-method mac_acaddoc 'saveas mac_acaddoc_newname acr14_dwg)
(alert (strcat "Drawing was saved as a new revision:\n"
mac_acaddoc_newname))
;; Release the old drawing
(vlax-release-object mac_acaddoc)
(vlax-release-object mac_acadapp)
;; Move the old drawing to an Old_Drawings Directory
(setq mac_acaddoc_newpath (strcat mac_acaddoc_path
"\\Old_Drawings")
mac_acaddoc_newfullname (strcat mac_acaddoc_newpath "\\"
mac_acaddoc_name)
)
;; Verify that the directory exists or create it
(if (= (vl-directory-files mac_acaddoc_newpath nil) nil)
(vl-mkdir mac_acaddoc_newpath)
)
(if (vl-directory-files mac_acaddoc_newpath nil)
;; Check if a drawing already exists in the Old_Drawings Directory
(if (findfile mac_acaddoc_newfullname)
(alert
(strcat "An existing file with the same name was\nfound in the
following directory:\n"
mac_acaddoc_newpath
"\nThe old drawing cannot be moved over to this directory."
)
)
;; No existing drawing was found so try to copy the old drawing over
(if (vl-file-copy mac_acaddoc_fullname mac_acaddoc_newfullname)
(if (and (vl-file-delete mac_acaddoc_fullname)
(or (= (findfile mac_acaddoc_backupfullname) nil)
(vl-file-delete mac_acaddoc_backupfullname)
)
)
(alert
(strcat "The old drawing was moved over to this directory:\n"
mac_acaddoc_newpath)
)
(alert (strcat "The old drawing was copied over to this directory:\n"
mac_acaddoc_newpath
"\nBut it could not be deleted from the original directory."
)
)
)
(alert (strcat "The old drawing could not be copied to the following
directory:\n"
mac_acaddoc_newpath
)
)
)
)
(alert (strcat "The following directory could not be created:"
mac_acaddoc_newpath
"\nThe old drawing cannot be moved over to this directory."
)
)
)
)
(alert "An error occurred and the drawing was\nnot saved as a new
revision")
)
(princ)
)

--
Rodney McManamy
President
MACSolids
Maximizing AutoCAD Solids
rmcmanamy@macsolids.com
"Rodney McManamy" wrote in message
news:82EEED6578AE334073E886A60CE531DC@in.WebX.maYIadrTaRb...
> I don't think that R14 supported the dwgprops so I'm guessing that you
would
> be appending the revised drawing name.
> Drawing-A.dwg -> Drawing-B.dwg
>
> This is quick and dirty, no error checking involved bu will look for a
> drawing revision at the end of the filename -A. If no revision is found
> then it will create the -A revision. It will also attempt to create an
> Old_Drawings subdirectory and move the old file over. It also saveas the
> new drawing as the R14 dwg type for you. Help it helps but I haven't had
my
> morning coffee yet so I don't give any warranties. But it worked on my
> NT4.0 and AutoCAD 2000i.
>
> (defun c:revision (/ mac_acadapp mac_acaddoc
> mac_acaddoc_name mac_acaddoc_basename mac_acaddoc_path
> mac_acaddoc_fullname mac_oldrevision mac_acaddoc_basename
> mac_newrevision mac_acaddoc_newname mac_acaddoc_newpath
> mac_acaddoc_newfullname
> )
> (vl-load-com)
> (setq mac_acadapp (vlax-get-acad-object)
> mac_acaddoc (vlax-get-property mac_acadapp 'activedocument)
> mac_acaddoc_name (vlax-get-property mac_acaddoc 'name)
> mac_acaddoc_basename (vl-filename-base mac_acaddoc_name)
> mac_acaddoc_path (vlax-get-property mac_acaddoc 'path)
> mac_acaddoc_fullname (vlax-get-property mac_acaddoc 'fullname)
> )
> ;; Determine if a drawing revision already exists as a letter
> (if (wcmatch mac_acaddoc_basename "*-@")
> (setq mac_oldrevision (strcase (substr mac_acaddoc_basename
(strlen
> mac_acaddoc_basename)))
> mac_acaddoc_basename (substr mac_acaddoc_basename 1 (- (strlen
> mac_acaddoc_basename) 2))
> mac_newrevision (chr (+ (ascii mac_oldrevision) 1))
> )
> (setq mac_newrevision "A")
> )
> (setq mac_acaddoc_newname (strcat mac_acaddoc_path "\\"
> mac_acaddoc_basename
> "-" mac_newrevision ".dwg"
> )
> )
> (vlax-invoke-method mac_acaddoc 'saveas mac_acaddoc_newname acr14_dwg)
> ;; Verify that the drawing was actually saved
> (if (= (strcase (vl-filename-base mac_acaddoc_newname))
> (strcase (vl-filename-base (vlax-get-property mac_acaddoc 'name)))
> )
> (progn
> (alert (strcat "Drawing was saved as a new revision:\n"
> mac_acaddoc_newname))
> ;; Move the old drawing to an Old_Drawings Directory
> (setq mac_acaddoc_newpath (strcat mac_acaddoc_path
> "\\Old_Drawings")
> mac_acaddoc_newfullname (strcat mac_acaddoc_newpath "\\"
> mac_acaddoc_name)
> )
> ;; Verify that the directory exists or create it
> (if (= (vl-directory-files mac_acaddoc_newpath nil) nil)
> (vl-mkdir mac_acaddoc_newpath)
> )
> (if (vl-directory-files mac_acaddoc_newpath nil)
> ;; Check if a drawing already exists in the Old_Drawings Directory
> (if (findfile mac_acaddoc_newfullname)
> (alert
> (strcat "An existing file with the same name was\nfound in the
> following directory:\n"
> mac_acaddoc_newpath
> "\nThe old drawing cannot be moved over to this directory."
> )
> )
> ;; No existing drawing was found so try to copy the old drawing over
> (if (vl-file-copy mac_acaddoc_fullname mac_acaddoc_newfullname)
> (if (vl-file-delete mac_acaddoc_fullname)
> (alert
> (strcat "The old drawing was moved over to this directory:\n"
> mac_acaddoc_newpath)
> )
> (alert (strcat "The old drawing was copied over to this
directory:\n"
> mac_acaddoc_newpath
> "\nBut it could not be deleted from the original directory."
> )
> )
> )
> (alert (strcat "The old drawing could not be copied to the following
> directory:\n"
> mac_acaddoc_newpath
> )
> )
> )
> )
> (alert (strcat "The following directory could not be created:"
> mac_acaddoc_newpath
> "\nThe old drawing cannot be moved over to this directory."
> )
> )
> )
> )
> (alert "An error occurred and the drawing was\nnot saved as a new
> revision")
> )
> (princ)
> )
>
> --
> Rodney McManamy
> President
> MACSolids
> Maximizing AutoCAD Solids
> rmcmanamy@macsolids.com
> "John Laidler" wrote in message
> news:DB752E1A197C4A46CA3FC6695ED7129A@in.WebX.maYIadrTaRb...
> > We're using A2Ki, but saving as R14.
> > The command shouldn't perform each time the drawing is opened, rather it
> > should perform when prompted.
> >
> > "Rodney McManamy" wrote in message
> > news:53D0DAC15352A720CA1A71A725EE7B14@in.WebX.maYIadrTaRb...
> > > It sounds simple enough. If your using R2000 or R2000i I may be able
to
> > > help you out. Do you want a command to perform this each time they
open
> a
> > > drawing or just when they run the command. Also, are all of the
> drawings
> > > R2000 with the dwgprops tracking the revisions?
> > >
> > > --
> > > Rodney McManamy
> > > President
> > > MACSolids
> > > Maximizing AutoCAD Solids
> > > rmcmanamy@macsolids.com
> > > "John Laidler" wrote in message
> > > news:4EFB32A9DC86A5DC4CB7DDA9CD170C9E@in.WebX.maYIadrTaRb...
> > > > We are currently looking for a program or software that will
> > automatically
> > > > update a drawing's revision. Then move the older drawing to an
> archive
> > > > directory, or change the revision letter in the drawing name. Any
> > > > suggestions would be greatly appreciated.
> > > >
> > > > --
> > > > John Laidler
> > > > Cad Manager
> > > > Duckworth & Associates, Inc.
> > > > (734) 455-7500
> > > >
> > >
> >
>

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Administrator Productivity


Autodesk Design & Make Report