TheSwamp
CAD Forums => CAD General => Topic started by: MSTG007 on January 16, 2018, 11:06:18 AM
-
Dumb question... Is there a procedure to offset then select a distance between two points, then say divided that distance by 3 and it calculates that value? (Then normal offsetting).
I hope that makes sense lol. Currently, I am just getting a distance, type via the ('CAL) command, then offset and type in that value.
Thanks for any advice...
-
are you really offsetting, or might this be a place for a tool like the one on the points tool palette to project slopes, etc?
-
You could be right... I need to go check that out. That might be what I am looking for.
-
Also, as an experiment
I just tried this @ offset command
OFFSET
it asks for distance I entered 2/3 it accepted that
I tried 2*3 it hated that
So it will take some fractions....but not other math at command prompt
-
Try Create Points-Interpolate under utilised in every sense of the word
-
Thanks for trying it out and letting me know.
-
Maybe this?
(defun c:div (/ d n s)
(and
(setq d (getdist "\nPick distance"))
(setq n (getreal "\nEnter divider"))
(setq s (/ d n))
)
s
)
Command: offset
Current settings: Erase source=No Layer=Source OFFSETGAPTYPE=0
Specify offset distance or [Through/Erase/Layer] <Through>: 'div
-
I understood that you specify point [Through] option, so apparently you don't know main distance in advance... So what you could try is perhaps something like this :
(defun c:offptdiv ( / p c d n )
(vl-load-com)
(setq p (getpoint "\nPick or specify point : "))
(while (or (not (setq c (car (entsel "\nPick curve for offset...")))) (if c (vl-catch-all-error-p (vl-catch-all-apply 'vlax-curve-getstartpoint (list c)))))
(prompt "\nMissed or picked wrong entity type...")
)
(setq d (distance p (vlax-curve-getclosestpointto c p)))
(initget 7)
(setq n (getint "\nSpecify divisor : "))
(vl-cmdf "_.OFFSET" (/ d n) c "_non" p "")
(princ)
)
I just wrote the code from my head, so you probably need debugging...
HTH., M.R.
-
For example, I have a vertical and a horizontal line. I want to offset out a grid.
I know I want to use the horizontal line but I really don't know the distance.
With the routine, I could select the distance by picking the begin and end point of the horiz line.
Then I can say I want 5 rows.
Then offset that distant without use a calculator is kinda what I was seeing.
I don't know what I did, I can not seem to get this to work.
-
I've corrected my code, but still not quite sure is it just the thing you are looking for...
-
I think at the beginning of the code, I would want to click the distance. (From first point to the last) (I can only click once).
Then it asks for a curve to offset. I select the vertical Line.
It asks for a specify divisor, I type in 5. (Value must be positive and nonzero) and goes to the offset command.
Pick or specify point : _endp,_app of
Pick curve for offset...
Specify divisor : 5
Value must be positive and nonzero.
Specify offset distance or [Through/Erase/Layer] <Through>:
Select object to offset or [Exit/Undo] <Exit>:
Command:
-
at the prompt for a distance, key in (/ (getdist) 3), pick your two points (osnaps allowed) and rock on. change the number 3 to whatever suits your needs.
-
its literally that easy?
-
My code does the same thing with less syntax. 8)
-
Geesh its been a long day! CABs. yours is easier to execute lol. guys sorry about the head ache.