Results 1 to 2 of 2

Thread: Creating a new revision

  1. #1
    Woo! Hoo! my 1st post
    Join Date
    2012-05
    Posts
    1

    Default Creating a new revision

    Hey guys,

    I'm new to auto lisp script and I was wondering if anyone could help me out? I'm trying to create a script that finds the last revision number from a cad file "C:\directory\project number\drawing number-rev1.dwg" and rev it up to the next number and does a save as. I'm not sure how to start one.

    Thanks for any help!

  2. #2
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,210

    Default Re: Creating a new revision

    Here you go, almost not tested
    Code:
      (defun GetSummaryItem(filename opt / sinfo revno)
        (vl-load-com)
        (setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
        (setvar "sdi" 0)
        (setq ndoc (vla-open (vla-get-documents (vlax-get-acad-object)) filename :vlax-true nil))
        (setq sinfo (vla-get-SummaryInfo ndoc))
    
        (setq revno (vlax-get-property  sinfo opt ))
        (vla-close ndoc :vlax-false)    
      
        revno
    )
      ;;	usage:
      
      ;;	(setq revision (GetSummaryItem "C:\\Test\\tempt.dwg" "RevisionNumber"))");<-- change file name and option to retrieve
      
    ;;----------------------------------------------------;;
      
      (defun SummarySet(filename  / doc n ndoc sinfo values)
        (vl-load-com)
        
        (setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
        (setvar "sdi" 0)
        (setq ndoc (vla-open (vla-get-documents (vlax-get-acad-object)) filename :vlax-false nil))
        (setq sinfo (vla-get-SummaryInfo ndoc))
        (setq values '("big boss" "comments here" "www.augi.com" "keywords here" "dummy" "001" "subject here" "title here"));<-- set your properties here
        
        (setq n 0)
        
        (foreach prop  '(Author
    		     Comments
    		     Hyperlinkbase
    		     Keywords
    		     LastSavedBy
    		     RevisionNumber
    		     Subject
    		     Title
    		     )
          (if (vlax-property-available-p sinfo prop T)
    	
    	  (vlax-put-property sinfo prop (nth n values)))
    	   (setq n (1+ n))
    	)
            
        (vla-save ndoc)
        (vla-close ndoc)
        (princ)
    )
      ;;	 usage:
      
      ;;	(SummarySet "C:\\Test\\temp.dwg");<-- change file name
    ~'J'~
    "The whole problem with the world is that fools and fanatics are always
    so certain of themselves, and wiser people so full of doubts."
    Bertrand Russell

Similar Threads

  1. Revision Clouds line weight different per Revision
    By billy007nh in forum Revit Architecture - General
    Replies: 7
    Last Post: 2010-11-18, 04:55 PM
  2. Creating Drawing List which shows Revision
    By drodrigues in forum Revit Architecture - General
    Replies: 2
    Last Post: 2008-07-31, 08:59 PM
  3. Creating a Revision Schedule
    By jrichardson in forum Revit Structure - General
    Replies: 1
    Last Post: 2006-10-13, 08:20 PM
  4. Creating An Attribute Block For Revision or Title Block
    By fnguyen05 in forum AutoCAD General
    Replies: 2
    Last Post: 2005-12-22, 02:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •