Author Topic: Offseting by Selecting points then divide  (Read 3080 times)

0 Members and 1 Guest are viewing this topic.

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Offseting by Selecting points then divide
« 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...
Civil3D 2020

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Offseting by Selecting points then divide
« Reply #1 on: January 16, 2018, 04:20:54 PM »
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?
Be your Best


Michael Farrell
http://primeservicesglobal.com/

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Re: Offseting by Selecting points then divide
« Reply #2 on: January 16, 2018, 04:39:16 PM »
You could be right... I need to go check that out. That might be what I am looking for.
Civil3D 2020

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Offseting by Selecting points then divide
« Reply #3 on: January 16, 2018, 04:42:27 PM »
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
Be your Best


Michael Farrell
http://primeservicesglobal.com/

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Offseting by Selecting points then divide
« Reply #4 on: January 16, 2018, 04:43:31 PM »
Try Create Points-Interpolate  under utilised in every sense of the word
Be your Best


Michael Farrell
http://primeservicesglobal.com/

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Re: Offseting by Selecting points then divide
« Reply #5 on: January 16, 2018, 04:43:43 PM »
Thanks for trying it out and letting me know.
Civil3D 2020

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Offseting by Selecting points then divide
« Reply #6 on: January 31, 2018, 12:16:41 PM »
Maybe this?

Code: [Select]
(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've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: Offseting by Selecting points then divide
« Reply #7 on: January 31, 2018, 01:41:01 PM »
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 :

Code: [Select]
(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.
« Last Edit: January 31, 2018, 02:03:20 PM by ribarm »
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Re: Offseting by Selecting points then divide
« Reply #8 on: January 31, 2018, 01:53:34 PM »
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.

Civil3D 2020

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: Offseting by Selecting points then divide
« Reply #9 on: January 31, 2018, 02:04:59 PM »
I've corrected my code, but still not quite sure is it just the thing you are looking for...
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Re: Offseting by Selecting points then divide
« Reply #10 on: January 31, 2018, 02:25:11 PM »
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.

Code: [Select]
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:
Civil3D 2020

cadtag

  • Swamp Rat
  • Posts: 1152
Re: Offseting by Selecting points then divide
« Reply #11 on: January 31, 2018, 03:22:56 PM »
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.
The only thing more dangerous to the liberty of a free people than big government is big business

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Re: Offseting by Selecting points then divide
« Reply #12 on: January 31, 2018, 03:25:35 PM »
its literally that easy?
Civil3D 2020

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Offseting by Selecting points then divide
« Reply #13 on: January 31, 2018, 04:13:16 PM »
My code does the same thing with less syntax.  8)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Re: Offseting by Selecting points then divide
« Reply #14 on: January 31, 2018, 04:19:29 PM »
Geesh its been a long day! CABs. yours is easier to execute lol. guys sorry about the head ache.
Civil3D 2020