Author Topic: Circle command calc with Scale Factor  (Read 1541 times)

0 Members and 1 Guest are viewing this topic.

tdeleske

  • Guest
Circle command calc with Scale Factor
« on: March 22, 2016, 02:36:58 PM »
I had been asked a while back to hack or override the default commands for Circle, Offset and Dist to automatically calc the Grid scale factor with a keyed in value, we were able to have this work in 2013 Civil 3D but now that we have moved to 2016 Civil 3D are having stability issues and am looking for an alternative idea, I have a Jr programmer that had built this with .NET and LISP,
I am not certain that using ,NET was the correct approach and may have over complicated the solution, explaining it will be difficult as I do not fully understand how it was built, rather than debugging it I am looking for an alternate approach that would not involve .NET.

I know I will get a lot of 'why would you want do that?' so I will explain why, in Alberta it is industry standard that Surveyors Survey in UTM Grid, Drafters draw lines in Grid and label everything in ground distance, we have a number of custom lisp routines that label Grid to Ground with Scale factor, so drawing lines and labeling with scale factor is handled.

Summary, if anyone has ideas on how to hack the Circle, Offset and Dist factory commands to allow the Transformation Grid Scale Factor value to be calculated with a keyed value would be amazing.

Trevor
« Last Edit: March 22, 2016, 03:05:18 PM by tdeleske »

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Circle command calc with Scale Factor
« Reply #1 on: March 22, 2016, 02:46:45 PM »
Can you post a drawing with examples?  Welcome to TheSwamp btw :)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

ymg

  • Guest
Re: Circle command calc with Scale Factor
« Reply #2 on: March 22, 2016, 03:09:00 PM »
tdeleske,

Not sure i follow you.  The UTM scale factor is 0.9996 at the central meridian.

I guess you are getting a value for scale factor near the location you are working
and want to apply it when you creates a circle or offset an entity.

So If you simply assign your scale factor to a variable let say sf with
the following:

Code: [Select]
(setq sf 0.9996)
Here replace the 0.9996 with your scale factor.

When prompted for the distance or radius in a command,
you would enter:
 
Code: [Select]
(* 300.256 sf)
instead of entering only 300.256

ymg

tdeleske

  • Guest
Re: Circle command calc with Scale Factor
« Reply #3 on: March 22, 2016, 03:26:11 PM »
Yes you are correct "ymg" the scale factor changes dependent on where we are working so it is almost always different from drawing to drawing,
your solution would make it happen in the moment but not preferred because the sf is constant and hard coded (unless I am missing something),
because we have many routines that call the scale factor, the drafters want it to be quick and to be able to have all of the default functionality (the reason for the ask),
we did have custom lisp functions at one point to offset and circle with scale factor but they did not have all of the functions inside like the default commands,
The message in our company is we always want a circle and offset to calc the sf. because if there is a time where we would not, we would have the sf set to 1.

ymg

  • Guest
Re: Circle command calc with Scale Factor
« Reply #4 on: March 22, 2016, 03:43:38 PM »
tdeleske,

Setting sf to whatever you need would be done when you start a drawing.

You could also keep it in one of the userr1-5 variables. These gets saved with
the drawing.

Instead of putting the value in a variable, you could also creates a function
that calculates the scale factor based on the position of center of screen
and prompt you to enter or pick a distance and apply the scale factor to
this distance.

Say we name the function sf, now when prompted for a distance you would
enter (sf), this would send you in the function which will get the distance
and returns that distance scaled to position of screen center.

The alternative of redefining standard command is opening a can of worms.

As of now, How do you calculate your scale factor ?

ymg
« Last Edit: March 22, 2016, 04:01:21 PM by ymg »

tdeleske

  • Guest
Re: Circle command calc with Scale Factor
« Reply #5 on: March 22, 2016, 03:54:08 PM »
we are currently setting the scale factor in EDITDRAWINGSETTINGS in the Transformation tab, User defined Scale Factor, we actually have a pop up for coord sys and sf if they have not been set, that will carry the settings into the drawing settings fields, I am fully aware to concerns around redefining the standard commands but the people asking are insistent as they had it working well in the past and liked it,
I really did try to deter them away from the idea.

ymg

  • Guest
Re: Circle command calc with Scale Factor
« Reply #6 on: March 22, 2016, 04:10:58 PM »
tdeleske,

That means your scale factor is kept in sysvar somewhere.

So a small function like the following:

Code: [Select]
(defun sd ()
    (* (getvar "NAMEOFVAR" ) (getdist))
)

So answering (sd) when prompted for a distance would do the trick.

ymg

ymg

  • Guest
Re: Circle command calc with Scale Factor
« Reply #7 on: March 22, 2016, 04:33:23 PM »
tdelske,

I don't work with C3D, but your request seems strange to me.

Normally you would work with a local coordinate system without
applying any scale factor.

The transformation tab in your drawing then takes care of
applying any scale and or translation to get UTM coordinates.

But I could be wrong, as I told you never worked with it.

ymg


tdeleske

  • Guest
Re: Circle command calc with Scale Factor
« Reply #8 on: March 24, 2016, 09:17:43 AM »
thanks for your help ymg, the code was written in 98% .NET because my programmer was not able to access the Civil 3D transformation scale factor field with lisp, we have been provided code by RK.McSwain to access that field with lisp, we are going to use this code and change our approach to see if it can be done with lisp fully.