Results 1 to 3 of 3

Thread: Drawings with different dimscales?

  1. #1
    Member
    Join Date
    2001-08
    Posts
    24
    Login to Give a bone
    0

    Default Drawings with different dimscales?

    How do I make this work on drawings of varying dimscales? I'm assuming I have to multiply the points times each known scale.
    So (* 8 txt2) ? For 1 1/2"

    (defun c:Foo4 (/ pt1 pt2 ss1)

    (setq pt1 '(33.375 21.4375) pt2 '(31.875 5.3125))
    (setq ss1 (ssget "c" pt1 pt2 '((0 . "mtext,text")))

    (command "change" ss1 "" "Properties" "layer" "Text2" "")
    (princ)
    )

    J. Logan
    ACAD 2016
    Last edited by jlogan02; 2017-12-26 at 05:17 PM.

  2. #2
    Member
    Join Date
    2001-08
    Posts
    24
    Login to Give a bone
    0

    Default Re: Drawings with different dimscales?

    Per Tom Beauford's suggestions, I placed some code I have written inside the nice quoted area. This avoids smiley faces apparently. Nice!

    I'm trying to select all mtext and text objects in a revision area to put them on a layer "Text2".

    This works great while in a drawing whose dimscale is set to 1. We work solely in Model Space and almost exclusively in a 34x22 title block with dimscale set to 1. But we do have instances of scaled title blocks for scales ranging from 1/4"=1' on up to 3"=1'. Initially all I did was copy the routine that covered our typical title block and multiply all the coordinates by 8 (eight) for a 1 1/2"=1'-0" title block. Got that done and realized I can do better by getting the dimscale of the drawing first then doing the magic. Unfortunately we do not use object based layering so I couldn't just say get all of the objects on this layer. I have to use a crossing window in the revision arae to get all of the mtext and text objects and change them to "Text2" layer.

    Code:
    (setq txt2 (ssget "c"
    	            	  '(33.375 21.4375)
    			  '(31.875 5.3125)
    			  '((0 . "MTEXT,TEXT"))
    			  )
    	      )
    
    (command "change" txt2 "" "Properties" "layer" "Text2" "")
    I decided I could do better, so started in on this code...
    Find the dimscale of the drawing (I'm not doing that below for sure)
    Use the dimscale to multiply the coordinates listed (setq txt2 to select the objects where they should be (267,171.5)(255,42.5) in the scaled title block. In this case 1 1/2" = 1'
    Change selected text objects at the new coordinates to layer "Text2"

    Code:
    (defun c:Foo4 (/ Rev1 en1 ed)
    (setvar "cmdecho" 1)
    
    (setq Rev1 (mapcar '(lambda (x)(* x 8))'(31.875 5.3125 33.375 21.4375)
          )
    
    (setq en1 (entlast))
      (setq ed (entget en1))
      (setq ed (subst (cons 8 "Text2") (assoc 8 ed) ed))
    	(entmod ed)
    	 
    (setvar "cmdecho" 0)
    (princ)
    )
    I've tested...
    (setq pt1 (mapcar '(lambda...as above
    (setq en1 (entlast

    and it works, to a point. It doesn't seem to select everything in the Revision area. It only selects one revision right in the middle of the revision area.
    Ohttt, answered my own question there. (entlast)) is the last thing the crossing window selects. How to (enteverything ? nentselp?

    My dimscale answer might be that I create a list of ...
    (setq Rev1 (mapcar '(lambda (x)(* x "Y"))'(31.875 5.3125 33.375 21.4375)

    where "Y" is the dimscale of each title block we use?

    orrr....(setq dim1 (ssget "dimscale")

    I'd be surprised if I'm even close with any of this.

    J. Logan
    ACAD 2016
    Last edited by jlogan02; 2017-12-27 at 06:15 PM.

  3. #3
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: Drawings with different dimscales?

    First you need to learn how to post code on a forum. Click the [Go Advanced] button at the bottom, then click the [#] button on the expanded toolbar at the top and place your code inside. That prevents smiley faces, preserves code and indentations.
    Example:
    Code:
    (defun c:Foo4 (/ ss1 pt1 pt2)
    You can edit your post to fix it.

    Most important thing is to state exactly what you want the code to do. All we really know now it your code doesn't do it.

    DIMSCALE sounds like the system variable you're looking for, but for folk like myself that use annotative dimensions it's value is always 0. If it were me I'd use the CANNOSCALE system variable.

Similar Threads

  1. Do you review drawings? what does a good set of drawings look like to you?
    By Paul Munford in forum CAD Management - General
    Replies: 36
    Last Post: 2018-10-22, 04:47 PM
  2. 2014: Set of drawings
    By scottyermer in forum Revit Architecture - General
    Replies: 5
    Last Post: 2014-03-20, 06:04 AM
  3. Search text within drawings, without actually opening drawings
    By Animesh Kundu in forum AutoCAD General
    Replies: 3
    Last Post: 2008-02-29, 05:34 PM
  4. 4-D Drawings
    By philA in forum AutoCAD LT - Wish List
    Replies: 0
    Last Post: 2005-08-17, 02:48 PM
  5. electrical drawings
    By tect75 in forum Revit Architecture - General
    Replies: 7
    Last Post: 2005-07-27, 08:59 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
  •