Author Topic: Help..Calling all Corinthians, Dorians and other columnists.  (Read 3587 times)

0 Members and 1 Guest are viewing this topic.

V-Man

  • Bull Frog
  • Posts: 343
  • I exist therefore I am! Finally Retired!
Help..Calling all Corinthians, Dorians and other columnists.
« on: November 10, 2004, 05:20:24 PM »
I am trying to write a routine that will draw a column (using the rectangle command). The insertion point is the column intersection point and it prompts the user to type in the column size in the "x" direction and then the "y" direction. From that it need to calculate and draw in the column from the column intersection. I'm having some trouble with that. Any ideas?
AutoCAD 9 - 2023, AutoCADMap 2008 - 2010, Revit 2012 - 2022, Autocad Civil 3D 2023

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Help..Calling all Corinthians, Dorians and other columnists.
« Reply #1 on: November 10, 2004, 05:52:52 PM »
Can you show us what you have so far?
What exactly is the column intersect point?
  Is it the corner of the column? Which corner?
  What is it intersecting with?
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.

daron

  • Guest
Help..Calling all Corinthians, Dorians and other columnists.
« Reply #2 on: November 11, 2004, 08:08:26 AM »
Don, I edited the name of your thread to better help others to know right away what they're in for when selecting this thread. Do you know how many threads there'd be with the title HELP..., if we left them alone. Sorry, what was your question again?

V-Man

  • Bull Frog
  • Posts: 343
  • I exist therefore I am! Finally Retired!
Help..Calling all Corinthians, Dorians and other columnists.
« Reply #3 on: November 11, 2004, 08:12:06 AM »
Ok, here is the code. I know it's not pretty but it does work. Any suggestions welcome of course.

Code: [Select]

(defun c:col ( / savosmode savortho pt xcol ycol divx divy newx newy x1 x3 x4 dir1 dir2 newans newans1)
(setq savosmode (getvar "osmode"))
(setq savortho (getvar "orthomode"))
(setvar "osmode" 32)
(setq pt (getpoint "\nSelect column intersection point:"))
(setq XCOL (getdist "\nEnter the X direction size: "))
(setq YCOL (getdist "\nEnter the Y direction size: "))
(setq divx (/ xcol 2))
(setq divy (/ ycol 2))
(setq newx (rtos divx))
(setq newy (rtos divy))
(setq newans (strcat "@" newx "<" "180"))
(setq newans1 (strcat "@" newy "<" "270"))
(setq xans (strcat "@" (rtos xcol) "," (rtos ycol)))
(command "rectangle" pt xans)
(setvar "osmode" 0)
(setvar "orthomode" 1)
(command "move" (entlast) "" "0,0" newans)
(command "move" (entlast) "" "0,0" newans1)
(setvar "osmode" savosmode)
(setvar "orthomode" savortho)
(princ)
)
AutoCAD 9 - 2023, AutoCADMap 2008 - 2010, Revit 2012 - 2022, Autocad Civil 3D 2023

SMadsen

  • Guest
Help..Calling all Corinthians, Dorians and other columnists.
« Reply #4 on: November 11, 2004, 08:34:20 AM »
You mean it's a rectangle-from-center kind of routine you're putting together?

I'd suggest some basic point calculations. You could look into POLAR or - provided the column section is orthogonal in WCS - you could simply build diagonal points on the fly. E.g. something like:

Code: [Select]
(defun c:col (/ pt xcol ycol divx divy llpt urpt savosmode)
  (setq savosmode (getvar "osmode"))
  (setvar "osmode" 32)
  (setq pt (getpoint "\nSelect column intersection point:"))
  (setq XCOL (getdist "\nEnter the X direction size: "))
  (setq YCOL (getdist "\nEnter the Y direction size: "))
  (setq divx (/ xcol 2.0))
  (setq divy (/ ycol 2.0))
 
  (setq llpt (list (- (car pt) divx)(- (cadr pt) divy))
        urpt (list (+ (car pt) divx)(+ (cadr pt) divy))
  )

  (setvar "osmode" 0)
  (command "rectangle" llpt urpt)
  (setvar "osmode" savosmode)
  (princ)
)

V-Man

  • Bull Frog
  • Posts: 343
  • I exist therefore I am! Finally Retired!
Help..Calling all Corinthians, Dorians and other columnists.
« Reply #5 on: November 11, 2004, 08:44:22 AM »
Quote

You mean it's a rectangle-from-center kind of routine you're putting together?


Yea, it's so that you can draw in a column, any size the user inputs from the (column) intersection. I knew that there was a smarter way of writng this routine but just needed a little direction.

Thanks,
AutoCAD 9 - 2023, AutoCADMap 2008 - 2010, Revit 2012 - 2022, Autocad Civil 3D 2023

hendie

  • Guest
Help..Calling all Corinthians, Dorians and other columnists.
« Reply #6 on: November 11, 2004, 09:31:47 AM »
I just love the title of this thread  :P

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Help..Calling all Corinthians, Dorians and other columnists.
« Reply #7 on: November 11, 2004, 09:39:18 AM »
Quote from: hendie
I just love the title of this thread  :P


I was wondering if this was a reference to the middle east around the time of Jesus, but then I was wondering if they had newspapers then ... and if not why would they need columnists ... but anyway it is kinda neat
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

t-bear

  • Guest
Help..Calling all Corinthians, Dorians and other columnists.
« Reply #8 on: November 11, 2004, 09:41:01 AM »
Yah, me too.  Seems our Daron has a poetic streak.......

daron

  • Guest
Help..Calling all Corinthians, Dorians and other columnists.
« Reply #9 on: November 11, 2004, 10:49:44 AM »
Quote from: Keith
Quote from: hendie
I just love the title of this thread  :P


I was wondering if this was a reference to the middle east around the time of Jesus, but then I was wondering if they had newspapers then ... and if not why would they need columnists ... but anyway it is kinda neat


Sort of, but aren't there Corinthian, Doric and other types of columns? It's all a play on words related to what I could figure out what Don was trying to ask.

Thanks for the love.

t-bear

  • Guest
Help..Calling all Corinthians, Dorians and other columnists.
« Reply #10 on: November 11, 2004, 11:07:03 AM »
Not love Daron....wonder and amazement.......LOL