[V8i Ss2] Variable Distance Key-In (Based on Active Scale)

All,

I recently stumbled across a key-in string that will orient a North arrow cell automatically when being placed.  This would be perfect if my firm liked to put the "Scale: " text with the same orientation as the arrow but they do not.  Instead we align the "Scale: " text with the view, which I think is pretty common.

Because of this,  I created a second cell, one with the text "$SCALE$" (A text substitution we make with our pen table using named expressions), and I expanded the key-in string to place the scale cell a distance of 1 unit below the arrow cell after the arrow cell is placed.

The string is now...

ac=North;aa=0;accudraw dialog;accudraw setorigin;accudraw rotate top;%d;accudraw rotate view;reset;ac=Scale;dx=0,-1,0;reset

My question then is, is there any way to make the distance of 1 unit a variable amount based off of the active scale?  

Something to the effect of ...dx=0,<as=>*-1,0...

I am anticipating the answer is a no, but I suggested solutions do not have to be limited to the key-in dialog.  I am open to macros and other utilities so long as the end result can get slapped on a function key.

Any suggestions?

Parents
  • Unknown said:

    All,

    I recently stumbled across a key-in string that will orient a North arrow cell automatically when being placed.  This would be perfect if my firm liked to put the "Scale: " text with the same orientation as the arrow but they do not.  Instead we align the "Scale: " text with the view, which I think is pretty common.

    Because of this,  I created a second cell, one with the text "$SCALE$" (A text substitution we make with our pen table using named expressions), and I expanded the key-in string to place the scale cell a distance of 1 unit below the arrow cell after the arrow cell is placed.

    The string is now...

    ac=North;aa=0;accudraw dialog;accudraw setorigin;accudraw rotate top;%d;accudraw rotate view;reset ( this part was mine)

    ac=Scale;dx=0,-1,0;reset ( you added this)

    Its so heart warming to see my little script circulating around the world I got the idea from and article on ask inga  for XM and refined it to work in 8i...

    I'm not sure why you need  the cell for the scale as I  use the scale in my sheet  as a ref file or a cell so its always the scale its attached in  also 

    when I bring is the north cell it was drawn so it equals 1:1000 scale plots when attached at 1:1 or scale 1 for cells

    if you know the drawing scale then you should be able to attach the north cell to factor that..

    I'm sure there must be a  way to find the drawing scale ( via a keyin or vba) then use the drawing scale to attach the north cell at the right scale..

    my original script had as=1 at the beginning so the north cell always came in at 1:1000 

    I drew a scale bar  at the edge of the title block and $SCALE$ below it  is drawn in master units   0-100m so it should self scale  ie the length 0-100 will always be  the same  based on the scale up or down of the sheet when printed to paper or am i confused?

    I did find this keyin dialog drawing scale open

    then you know the drawing scale so you can then keyin as= the drawing scale you need based on the drawing scale 

    Lorys

    Started msnt work 1990 - Retired  Nov 2022 ( oh boy am I old )

    But was long time user V8iss10 (8.11.09.919) dabbler CE  update 16 (10.16.00.80) 

    MicroStation user since 1990 Melbourne Australia.
    click link to PM me 

  • Glad I could warm your heart Lorys!

    It certainly is a nifty little snippet.  I certainly appreciate you sharing.  Not sure if I entirely understand...

    Unknown said:

    I drew a scale bar  at the edge of the title block and $SCALE$ below it  is drawn in master units   0-100m so it should self scale  ie the length 0-100 will always be  the same  based on the scale up or down of the sheet when printed to paper or am i confused?

    but I think the answer is no, you're not confused.  The whole point of a graphic scale (which I think is what you're talking about when you say scale bar) is that it is always correct regardless of the size it is printed out at.  My named expression that defines the text substitution $SCALE$ looks in the plot dialog for the printing scale and formats it as SCALE: 1" = XX'  (rounding the feet to zero decimal places.)  These two side by side provide the scale both graphically and textually but they have no relation to each other.

    Unknown said:

    I did find this keyin dialog drawing scale open

    then you know the drawing scale so you can then keyin as= the drawing scale you need based on the drawing scale 

    I'd really like to find a way to put as=<factor>*<annotationscale> at the beginning of the script to avoid having to check my active scale before firing the script.  Where here, <factor> would be a constant of (1/12) and the annotation scale would be, for example, 240 for a scale of 1"=20'.  The 1/12 factor is because our borders are drawn at 22 x 34 feet, referenced, and printed at 22 x 34 inches.  (I don't like that we do it this way.)

    I am happy with my most recent version of the code although it's just a convoluted way of doing what Brent suggested, which would be to create the cells about the same origin.

    However, I have been tinkering with trying to take this even one step further.  My new problem is that the distance $SCALE$ is placed underneath the north arrow is always the same (relative to the active scale) regardless of the orientation of the arrow.  I don't like this because as the arrow goes from vertical to horizontal the distance between the two cells increases.  I'd like to correct this to make the distance between the two cells always equal, or close to equal, by factoring with a trigonometric function based on the angle between the view orientation and the top orientation.  However, I still have yet to find a way to automate the task of determining that angle.  It is essentially just the rotation angle of the $SCALE$ cell but I have no good way of getting that value either.

    If you, Lorys, or anyone else has script to...

    1) turn the annotation scale to a single numerical value

    2) determine the angle between view and top

    I'd have the most unnecessarily cool code I've compiled to date.

    Thanks again Lorys and Brent 

Reply
  • Glad I could warm your heart Lorys!

    It certainly is a nifty little snippet.  I certainly appreciate you sharing.  Not sure if I entirely understand...

    Unknown said:

    I drew a scale bar  at the edge of the title block and $SCALE$ below it  is drawn in master units   0-100m so it should self scale  ie the length 0-100 will always be  the same  based on the scale up or down of the sheet when printed to paper or am i confused?

    but I think the answer is no, you're not confused.  The whole point of a graphic scale (which I think is what you're talking about when you say scale bar) is that it is always correct regardless of the size it is printed out at.  My named expression that defines the text substitution $SCALE$ looks in the plot dialog for the printing scale and formats it as SCALE: 1" = XX'  (rounding the feet to zero decimal places.)  These two side by side provide the scale both graphically and textually but they have no relation to each other.

    Unknown said:

    I did find this keyin dialog drawing scale open

    then you know the drawing scale so you can then keyin as= the drawing scale you need based on the drawing scale 

    I'd really like to find a way to put as=<factor>*<annotationscale> at the beginning of the script to avoid having to check my active scale before firing the script.  Where here, <factor> would be a constant of (1/12) and the annotation scale would be, for example, 240 for a scale of 1"=20'.  The 1/12 factor is because our borders are drawn at 22 x 34 feet, referenced, and printed at 22 x 34 inches.  (I don't like that we do it this way.)

    I am happy with my most recent version of the code although it's just a convoluted way of doing what Brent suggested, which would be to create the cells about the same origin.

    However, I have been tinkering with trying to take this even one step further.  My new problem is that the distance $SCALE$ is placed underneath the north arrow is always the same (relative to the active scale) regardless of the orientation of the arrow.  I don't like this because as the arrow goes from vertical to horizontal the distance between the two cells increases.  I'd like to correct this to make the distance between the two cells always equal, or close to equal, by factoring with a trigonometric function based on the angle between the view orientation and the top orientation.  However, I still have yet to find a way to automate the task of determining that angle.  It is essentially just the rotation angle of the $SCALE$ cell but I have no good way of getting that value either.

    If you, Lorys, or anyone else has script to...

    1) turn the annotation scale to a single numerical value

    2) determine the angle between view and top

    I'd have the most unnecessarily cool code I've compiled to date.

    Thanks again Lorys and Brent 

Children
No Data