Author Topic: I need to preset offset distance in this routine  (Read 2310 times)

0 Members and 1 Guest are viewing this topic.

ELOQUINTET

  • Guest
I need to preset offset distance in this routine
« on: March 18, 2008, 11:21:53 AM »
Hey guys I am trying to modify this reference line routine and want the distance to be preset to 18 inches. How would I modify this to do that? Currently I am doing furniture plans and need to draw a polyline around the outer profile of the fixture then offset the polyline out 18 inches to show the required clearance. I'd like to be able to automate the creation of the profile but can't see how that would be possible as I am only creating a profile of the parts that are more than 18 inches apart from one another. Am I making sense or is a picture required?

Code: [Select]
;;; DRAWS A LINE THEN ASKS WHICH SIDE TO OFFSET AND DISTANCE, CLEARANCE LINE

(defun c:FSCL (/ usercmd en1 clay dist)
  ;; -------  Some Housekeeping   ------------------
  (setq usercmd (getvar "CMDECHO"))
  (setvar "CMDECHO" 0)
  (setq clay (getvar 'clayer))
  (command "_.layer" "m" "I-FIXT-FLOR-HIDE" "C" 8 "" "")
  (setq useros (getvar "osmode"))
  (setvar "osmode" 175)
  (prompt "/nPick points, Enter when done.")
  ;; Draw the pline
  (command "PLINE") ;_ COMMAND
  (while (> (getvar "CMDACTIVE") 0)
    (command pause)
  )
  (setq en1 (entlast))
  (initget 1)
  (setq pto (getpoint "\nSide to offset:"))
  (setq dist (getreal "\nEnter offset distance:"))
  (command "_.offset" dist en1 pto "")
  (entdel en1) ; remove the user drawn line

  ;;==========  Exit Sequence  ============
  (setvar "CMDECHO" usercmd)
  (setvar "clayer" clay)
  ;; Exit quietly
  (princ)

) ;_end of defun

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: I need to preset offset distance in this routine
« Reply #1 on: March 18, 2008, 11:29:33 AM »
dan dan dan
You should know this. 8-)

Code: [Select]
;; (setq dist (getreal "\nEnter offset distance:"))
(setq dist 18.0)
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.

ELOQUINTET

  • Guest
Re: I need to preset offset distance in this routine
« Reply #2 on: March 18, 2008, 11:47:27 AM »
ha yeah but last night was insane and todays my birthday so I hope I'm pardoned. I am moreso just brainstorming a way of automating the process of finding the boundary and omitting points that are less than 18 inches from one another. I've attached a drawing to illustrate what I'm having to do hoping for ideas. What would be nice would be if it highlighted the boundary then asked me which points I did not need and it recreated the boundary until i got the desired profile. I know I'm a dreamer but it sure would make the job alot less tedious.

ELOQUINTET

  • Guest
Re: I need to preset offset distance in this routine
« Reply #3 on: March 18, 2008, 12:10:08 PM »
cab i tried putting that after the existing dist line and replacing that line with this and it still asks me for the distance. what am i doing wrong here?

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: I need to preset offset distance in this routine
« Reply #4 on: March 18, 2008, 12:13:01 PM »
Happy Birthday!

Looking at the DWG, that doesn't look like any furniture I ever saw and it's not clear to me what
you are trying to offset. I would need a more explicit example.
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.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: I need to preset offset distance in this routine
« Reply #5 on: March 18, 2008, 12:15:28 PM »
cab i tried putting that after the existing dist line and replacing that line with this and it still asks me for the distance. what am i doing wrong here?
Comment out the existing line & add the new line.
;; (setq dist (getreal "\nEnter offset distance:")) ; old line
(setq dist 18.0) ; new line
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.

ELOQUINTET

  • Guest
Re: I need to preset offset distance in this routine
« Reply #6 on: March 18, 2008, 12:20:40 PM »
thanks man. i am working at polo store development and am drawing the racks they hang clothes on in department store which is what this is in plan view. What I was trying to illustrate is that the true outline of the object includes the peach colored lines but the space between those line is less than 18 inches so they would be excluded from the profile. The profile would then be the white line offset 18 inches outward where the grey dotted line is. Does that make anymore sense?

GDF

  • Water Moccasin
  • Posts: 2081
Re: I need to preset offset distance in this routine
« Reply #7 on: March 18, 2008, 12:32:52 PM »
Happy Birthday!

On another note, Dan delete those layer filters!
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

ELOQUINTET

  • Guest
Re: I need to preset offset distance in this routine
« Reply #8 on: March 18, 2008, 12:56:32 PM »
yeah that's part of my cleanup procedure, just haven't got to it yet. thanks for the reminder

ELOQUINTET

  • Guest
Re: I need to preset offset distance in this routine
« Reply #9 on: March 18, 2008, 12:59:31 PM »
hehe just realized i just broke the 3000 post mark sweeeeet

ELOQUINTET

  • Guest
Re: I need to preset offset distance in this routine
« Reply #10 on: March 19, 2008, 09:30:51 AM »
So I guess nobody has anymore thoughts about how I might be able to accomplish this. I realize it might be a bit difficult to acheive but it would really help me. Do I have to beg  :cry:

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: I need to preset offset distance in this routine
« Reply #11 on: March 19, 2008, 10:05:31 AM »
Congrats on the >3000

Your request is too complex for a quick fix.

If you drew horizontal lines representing the vertical boundaries they could then be used to create the outline.
The outline could be offset the 18" and the outline erased.

This will only work on symmetrical objects.

I don't have time this week to tackle even that simple routine, I'm Swamped.
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.

ELOQUINTET

  • Guest
Re: I need to preset offset distance in this routine
« Reply #12 on: March 19, 2008, 12:40:24 PM »
Yeah I realize it's quite complex because I have many variables some of which I'm not even aware of yet so I completely understand.