Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: xref auto scale by using dimscale

  1. #1
    I could stop if I wanted to cadd4la's Avatar
    Join Date
    2001-12
    Location
    Newport Beach, CA
    Posts
    399
    Login to Give a bone
    0

    Question xref auto scale by using dimscale

    Hi everyone,

    I am looking for a VBA that when you xref a drawing, it reads the dimscale of the drawing that is going to be XREF into the drawing.

    Background.

    For my detail sheets I XREF in the details one at a time and scale them manually enter in a factor of taking the scale of the detail (not the Dimscale) and dividing it by 12.

    examples:

    3/4"=1'-0" wood be 0.75/12 = 0.0625 is the insert scale
    1"=1'-0" would be 1/12 = 0.083333333 is the insert scale

    I would like when xrefing each of the details that the scale be done automatically or if this can't be done, I would like a pulldown menu with a list of scales that has the factor for that detail scale.

    One problem I see, how do you take the dimscale of 16 (for 3/4" =1'-0") and get the insert scale of 0.0625?

    Thanks,

    Kyle C.

  2. #2
    100 Club mtuersley's Avatar
    Join Date
    2001-12
    Posts
    122
    Login to Give a bone
    0

    Default Re: xref auto scale by using dimscale

    I am looking for a VBA that when you xref a drawing, it reads the dimscale of the drawing that is going to be XREF into the drawing.
    <snip>
    ...and scale them manually enter in a factor of taking the scale of the detail (not the Dimscale) and dividing it by 12.
    Which is it? DIMSCALE value or not? You're contradicting yourself. If it's dimscale, then the XREF drawing can be pre-opened in DBX and have its dimscale value read - assuming that the dimscale is always correct. If its not dimscale, how would a program "know" what scale it was drawn at? Anything in the detail that gives that information?

    One problem I see, how do you take the dimscale of 16 (for 3/4" =1'-0") and get the insert scale of 0.0625?
    You take the reciprocal of the value so 1/16. How can you be confused if you do this manually???

  3. #3
    I could stop if I wanted to cadd4la's Avatar
    Join Date
    2001-12
    Location
    Newport Beach, CA
    Posts
    399
    Login to Give a bone
    0

    Default Re: xref auto scale by using dimscale

    mtuersley,

    Which is it? DIMSCALE value or not? You're contradicting yourself. If it's dimscale, then the XREF drawing can be pre-opened in DBX and have its dimscale value read - assuming that the dimscale is always correct.
    I would like it to use the DIMSCALE


    Anything in the detail that gives that information?
    The only other thing is the blocks that I use in the details are scaled to that detail's scale factor.


    You take the reciprocal of the value so 1/16. How can you be confused if you do this manually???
    Thanks for putting me in my place.

  4. #4
    100 Club mtuersley's Avatar
    Join Date
    2001-12
    Posts
    122
    Login to Give a bone
    0

    Default Re: xref auto scale by using dimscale

    Explode the blocks then you can use the DBX method, or rename them to a unique name specific to each detail. In general, you should never use blocks in details if you intend to insert the details into other drawings.

    FWIW it sounds like you'd be further ahead by editing all of your details to be 1=1 then you can accomplish the insert w/o issue.
    Last edited by mtuersley; 2005-05-18 at 04:37 PM.

  5. #5
    I could stop if I wanted to cadd4la's Avatar
    Join Date
    2001-12
    Location
    Newport Beach, CA
    Posts
    399
    Login to Give a bone
    0

    Default Re: xref auto scale by using dimscale

    mtuersley,

    How are you helping?



    Explode the blocks then you can use the DBX method, or rename them to a unique name specific to each detail. In general, you should never use blocks in details if you intend to insert the details into other drawings.
    What are you saying?



    FWIW it sounds like you'd be further ahead by editing all of your details to be 1=1 then you can accomplish the insert w/o issue.
    The blocks that are in the details are the callout number bubbles, the detail is drawn 1=1 then when the detail is xrefed into the detail sheet it's scaled by 1/x

  6. #6
    100 Club mtuersley's Avatar
    Join Date
    2001-12
    Posts
    122
    Login to Give a bone
    0

    Default Re: xref auto scale by using dimscale

    I can't help if you don't accurately describe your intent and existing environment. For example, this is the first you mentioned that your blocks are 1=1, which means you don't need their dimscale at all. All that you need is the insert xref example in the vba help file and you replace the example's scale factor with your own - which would be the same calc you're doing manually.

  7. #7
    100 Club mtuersley's Avatar
    Join Date
    2001-12
    Posts
    122
    Login to Give a bone
    0

    Default Re: xref auto scale by using dimscale

    Here is the example minus the ListBlocks subfunction:

    Sub Ch10_AttachingExternalReference()
    On Error GoTo ERRORHANDLER
    Dim InsertPoint(0 To 2) As Double
    Dim insertedBlock As AcadExternalReference
    Dim tempBlock As AcadBlock
    Dim msg As String, PathName As String

    ' Define external reference to be inserted
    InsertPoint(0) = 1
    InsertPoint(1) = 1
    InsertPoint(2) = 0
    PathName = "C:/Program Files/AutoCAD 2005/sample/City map.dwg"

    ' Add the external reference to the drawing
    Set insertedBlock = ThisDrawing.ModelSpace. _
    AttachExternalReference(PathName, "XREF_IMAGE", _
    InsertPoint, 1, 1, 1, 0, False)
    ZoomAll

    Exit Sub

    ERRORHANDLER:
    MsgBox Err.Description
    End Sub

    In this line:

    ' Add the external reference to the drawing
    Set insertedBlock = ThisDrawing.ModelSpace. _
    AttachExternalReference(PathName, "XREF_IMAGE", _
    InsertPoint, 1, 1, 1, 0, False)
    replace the 1,1,1,0 with yourCalcedDimscale,yourCalcedDimscale,1,0

  8. #8
    I could stop if I wanted to cadd4la's Avatar
    Join Date
    2001-12
    Location
    Newport Beach, CA
    Posts
    399
    Login to Give a bone
    0

    Default Re: xref auto scale by using dimscale

    mtuersley,

    I can't help if you don't accurately describe your intent and existing environment. For example, this is the first you mentioned that your blocks are 1=1, which means you don't need their dimscale at all. All that you need is the insert xref example in the vba help file and you replace the example's scale factor with your own - which would be the same calc you're doing manually.
    What block are you talking about? The only blocks that are in the drawing are the callout number bubbles that have att text in them and that is scaled to the scale factor of the detail - for example a detail that the final output is going to be 3/4"=1'-0" the block is scaled 16 times. the detail is drawn to 1"=1" and the dimscale is set to 16.

    I have upload a file that shows a typ. detail draw 1 to 1 in model space the dimscale is set to 16, the sq w/ the numbers are the only blocks in the drawing and they are scaled by 16. the purple text is for me to remember the scale of the detail and is on a nonprint layer.

    now, I would open the detail drawing file in layout space and xref this detail in at 1/16

    back to me original request - I would like a VBA program to read the dimscale so I don't have to remember the scale of that detail that I have in my detail library and was drawn six month ago.

    Kyle C.
    Attached Images Attached Images

  9. #9
    I could stop if I wanted to cadd4la's Avatar
    Join Date
    2001-12
    Location
    Newport Beach, CA
    Posts
    399
    Login to Give a bone
    0

    Exclamation Re: xref auto scale by using dimscale

    Hi everyone,

    I am still looking for help with my questions

    Thanks,

    Kyle C.

  10. #10
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: xref auto scale by using dimscale

    Since you cannot examine system variables in ObjectDBX, you need to store the scale factor in the detail in an Dictionary/XRecord, or examine the scale factor for a consistent object (title-line block) in the detail.

    Once you have a stored scale factor, you can use ObjectDBX to open the original detail to retrieve the data.

Page 1 of 3 123 LastLast

Similar Threads

  1. Replies: 10
    Last Post: 2012-04-11, 06:02 PM
  2. Replies: 0
    Last Post: 2011-11-17, 04:25 PM
  3. 2008 SCALE 1:100 xref xref xref xref- scale list issues
    By Apsis0215 in forum AutoCAD Customization
    Replies: 2
    Last Post: 2008-11-21, 08:17 PM
  4. Leader text to scale when dimscale is changed
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 1
    Last Post: 2005-10-07, 12:13 AM
  5. Table Scale similar to Dimscale
    By dbroad in forum AutoCAD Wish List
    Replies: 0
    Last Post: 2004-11-29, 02:06 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
  •