Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: Auto Numbering drawing View titles in multiple Layouts

  1. #11
    I could stop if I wanted to
    Join Date
    2006-03
    Location
    Midland, MI
    Posts
    335

    Default Re: Auto Numbering drawing View titles in multiple Layouts

    Thank you for these files, could explaiin them further? The dwg files are your title blocks, are the used with .lsp routines? Please advise, thank you.

  2. #12
    I could stop if I wanted to pbejse's Avatar
    Join Date
    2010-10
    Posts
    397

    Default Re: Auto Numbering drawing View titles in multiple Layouts

    Darren

    Could you possibly save the files you attached to 2007 version, i'm using acad2007 and the cant even run DwgTrueVew on my windows version.... [windows 7 starter]

    I worked on something similar a year or so ago. it might help, but i need to see what you got
    Last edited by pbejse; 2012-09-29 at 09:59 AM.

  3. #13
    I could stop if I wanted to
    Join Date
    2006-03
    Location
    Midland, MI
    Posts
    335

    Default Re: Auto Numbering drawing View titles in multiple Layouts

    Quote Originally Posted by pbejse View Post
    Darren

    Could you possibly save the files you attached to 2007 version, i'm using acad2007 and the cant even run DwgTrueVew on my windows version.... [windows 7 starter]

    I worked on something similar a year or so ago. it might help, but i need to see what you got
    Here is a 2007 version. May not open or work properly due to 2012 objects not compatible in 2007.

    Unable to upload files tonight. Maybe you can upload your files. I will be able to open yours. Please describe what you did similar last year.

  4. #14
    I could stop if I wanted to pbejse's Avatar
    Join Date
    2010-10
    Posts
    397

    Default Re: Auto Numbering drawing View titles in multiple Layouts

    Darren,

    I need to modify the code for it to work on your drawing, and not modify the drawing to fit the code. Hence i'm asking for a sample of your drawing in 2007 version.


  5. #15
    I could stop if I wanted to
    Join Date
    2006-03
    Location
    Midland, MI
    Posts
    335

    Default Re: Auto Numbering drawing View titles in multiple Layouts

    Quote Originally Posted by pbejse View Post
    Darren,

    I need to modify the code for it to work on your drawing, and not modify the drawing to fit the code. Hence i'm asking for a sample of your drawing in 2007 version.

    Here it is, Good luck!
    Attached Files Attached Files

  6. #16
    I could stop if I wanted to pbejse's Avatar
    Join Date
    2010-10
    Posts
    397

    Default Re: Auto Numbering drawing View titles in multiple Layouts

    Code:
    (defun c:DetNum ( / sortYX aDoc bn aLayout coll layblk)
    (vl-load-com)
    ;;;	pBe 13Oct2012	;;;
    (defun sortYX (ptlist / yvals newptlist)
    ;;;	Kent Cooper	;;;
      (foreach
         pt ptlist
        (if (not
              (vl-remove-if-not
                '(lambda (y) (equal (cadr pt) y 0.0001))
                yvals
                )
              )
          (setq yvals (cons (cadr pt) yvals))
          )                                
        )                                  
      (setq yvals (vl-sort yvals '(lambda (y1 y2) (> y1 y2))))                                      
      (foreach  yval yvals
        (setq pts (vl-remove-if-not
                      '(lambda (pt) (equal yval (cadr pt) 0.0001))
                      ptlist
                      )
          pts       (vl-sort pts '(lambda (pt1 pt2) (< (car pt1) (car pt2))))
          newptlist (append newptlist pts)
          )                                 
        )                                   
      newptlist
      )  
    (setq aDoc (vla-get-ActiveDocument (vlax-get-acad-object)))
    (if (tblsearch "BLOCK" (setq bn "View Label01"))
      	(progn
    	(vlax-for
    	   layout (setq aLayout (vla-get-layouts aDoc))
    	  (if (not (equal (setq ln (vla-get-name layout)) "Model"))
    	    (progn
    	      (vlax-for i (vla-get-block layout)
    	        (if (and
    	              (= (vla-get-objectname i) "AcDbBlockReference")
    	              (= (strcase (vla-get-effectivename i)) (strcase bn))
    	              )
    	          (setq coll (cons (list (vlax-get i 'InsertionPoint) i) coll))
    	          )
    	        )
    	      (setq layblk
    	         (cons
    	           (list ln (vla-get-taborder (vla-item aLayout ln)) coll)
    	           layblk ) coll nil
    	        )
    	      )
    	    )
    	  )
      (setq cnt 0)
      (foreach
         itm (vl-sort layblk (function (lambda (a b)
    			      (< (cadr a)(cadr b)))))
        (if (and (setq f (last itm)) (setq g (sortYX (mapcar 'car f))))
          (foreach
             pt g
            (if (setq b (assoc pt f))
              (vla-put-textstring
                (car
                  (vl-remove-if-not
                    '(lambda (j) (eq (vla-get-tagstring j) "DETAIL_NUMBER"))
                    (vlax-invoke (cadr b) 'GetAttributes)
                    ))
                  (itoa (setq cnt (1+ cnt)))
                  )
                )
              )
            )
          )
        )
    hth  )
      (princ)
       )
    HTH

  7. #17
    I could stop if I wanted to
    Join Date
    2006-03
    Location
    Midland, MI
    Posts
    335

    Default Re: Auto Numbering drawing View titles in multiple Layouts

    You are the King for the day! Thank you, works great!

    After further using the lisp; it does has a glitch. On one of the sheets, there are 6 view lables, the numbering went around in a circle vs. left to right, top to bottom. Please advise, thanks.
    Last edited by Darren Allen; 2012-10-03 at 03:02 PM.

  8. #18
    I could stop if I wanted to pbejse's Avatar
    Join Date
    2010-10
    Posts
    397

    Default Re: Auto Numbering drawing View titles in multiple Layouts

    I'm expecting that to happen, we may need a smarter sort routine, but in any case if the labels are lined up properly (horizontally aligned) then it would be numbered Left-to-Right , Top-to-Bottom.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Multiple layouts vs Multiple drawing files
    By mmilko.83044 in forum CAD Standards
    Replies: 26
    Last Post: 2009-06-12, 05:15 PM
  2. Drawing and view titles
    By mrecobs in forum AutoCAD Sheet Set Manager
    Replies: 1
    Last Post: 2005-10-04, 11:11 AM

Posting Permissions

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