The Z will come into functionality later on down the road. This is only the
first phase of the idea I have for this program. I am wanting to build more
functionality into it later, and am trying to keep doors open. Thanks for
all the help everyone. I have the prototype working and will post it for you
guys to play with when I get a bit more functionality built in.
Thomas D. Wooton
Southern Systems Inc.
"John Uhden" wrote in message
news:A6E83D2944B34AC38E9066C5FD8B162E@in.WebX.maYIadrTaRb...
> Just for your info, since it seems that you're not interested in any Z
> values, you could skip the Z component altogether, since the (distance)
> function will return the 2D distance if given only '(x y).
>
> --
> John Uhden, Cadlantic/formerly CADvantage
> --> mailto:juhden@cadlantic.com
> --> http://www.cadlantic.com
> 2 Village Road
> Sea Girt, NJ 08750
> Tel. 732-974-1711
> FAX 732-528-1332
>
> "Thomas D. Wooton" wrote in message
> news:E6394116B611AAB4159937A563C1FEBD@in.WebX.maYIadrTaRb...
> >
> > "Bobby Jones" wrote in message
> > news:295F86FC3FD3EC6239B65D06DA42EFB9@in.WebX.maYIadrTaRb...
> > > Thomas, could you post all of the code? Thanks.
> > > --
> > > Bobby C. Jones
> > > Dots & Parens living in harmony...
> > >
> > >
> > >
> >
> >
>
>
> --------------------------------------------------------------------------
--
> ----
>
>
> > ; kip.lsp
> > ; BY Thomas D. Wooton 10/07/01
> > ;
> *************************************************************************
> > ; *
> *
> > ; * Inputs kip loading numbers (Kilo/pounds) of weight distributed
> *
> > ; * over the specified supports. Start by selecting your conveyor path
> *
> > ; * (centerline of weight) and then your panel points (support
points).
> *
> > ; * next enter the average weight per foot. The program then generates
> *
> > ; * your kip loads and inputs them at the panel points.
> *
> > ; *
> *
> > ;
> *************************************************************************
> > ;
> > (DEFUN DTR (A)
> > (* PI (/ A 180.0))
> > )
> >
> > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; List line
> length
> > (defun C:LL (/ ENAME SP EP DIS)
> > ; screen prompts for info
> > (setq ENAME1 (entget (car (entsel "\nSelect Conveyor line: "))))
> > (setq ENAME2 (entget (car (entsel "\nSelect Support line: "))))
> > (setq lbs (getint "\nAverage Weight Per Foot "))
> > ; finding the x,y I need
> > (setq ETYPE1 (cdr (assoc 0 ENAME1)))
> > (setq SP1 (cdr (assoc 10 ENAME1)))
> > (setq EP1 (cdr (assoc 11 ENAME1)))
> > (setq x1 (car sp1))
> > (setq y1 (cadr sp1))
> > (setq x2 (car ep1))
> > (setq y2 (cadr ep1))
> > (setq ETYPE2 (cdr (assoc 0 ENAME2)))
> > (setq SP2 (cdr (assoc 10 ENAME2)))
> > (setq EP2 (cdr (assoc 11 ENAME2)))
> > (setq x3 (car sp2))
> > (setq y3 (cadr sp2))
> > (setq x4 (car ep2))
> > (setq y4 (cadr ep2))
> > (if (= ETYPE1 ETYPE2 "LINE")
> > (progn
> > ; calculates length of lines
> > (setq DIS1 (distance SP1 EP1))
> > (setq ANG1 (angle SP1 EP1))
> > (setq DIS2 (distance SP2 EP2))
> > (setq ANG2 (angle SP2 EP2))
> > ; calculates intersection of lines
> > ; I did not want to use the inters function because if they don't
> intersect I want it to error.
> > (setq ua (/ (- (* (- x4 x3) (- y1 y3)) (* (- y4 y3) (- x1 x3)))
> (- (* (- y4 y3) (- x2 x1)) (* (- x4 x3) (- y2 y1)))))
> > (setq answerx (+ x1 (* ua (- x2 x1))))
> > (setq answery (+ y1 (* ua (- y2 y1))))
> > ;
> > ;
> > ; Here is where I am wanting to take the x and y above and make a point
so
> > ; I can find the distance from this point to the start points and end
> points of each line.
> > ; If you draw two intersecting lines and run the routine you will get
the
> info
> > ; I have been able to extract and manipulate so far.
> > ; The intersection to end distance, divided by the total length, gives
me
> a percentage of
> > ; the total distance. Multiply this by your average weight, to find how
> much
> > ; weight is on each end of your supports. Ie your moment of inertia
> > ;
> > (setq d1 (list answerx answery 0))
> > ;
> > ;
> > ;
> > ;
> > ; calculates weight of each point
> > (setq kip1 (* (distance dis1 d1) lbs))
> > (setq kip2 (* (distance dis1 d1) lbs))
> > (setq kip3 (* (distance dis2 d1) lbs))
> > (setq kip4 (* (distance dis2 d1) lbs))
> > ; screen prompts
> > (prompt "\nDistance = ")(princ dis1)
> > (prompt "\nStart Point = ")(princ SP1)
> > (prompt "\nEnd Point = ")(princ EP1)
> > (prompt (strcat " Angle = " (angtos ANG1 0 4)))
> > (prompt (strcat "\nLength = " (rtos DIS1 4 4)))
> > (prompt "\nDistance = ")(princ dis2)
> > (prompt "\nStart Point = ")(princ SP2)
> > (prompt "\nEnd Point = ")(princ EP2)
> > (prompt (strcat "\nLength = " (rtos DIS2 4 4)))
> > (prompt "\nX1 = ")(princ x1)
> > (prompt "\nY1 = ")(princ y1)
> > (prompt "\nX2 = ")(princ x2)
> > (prompt "\nY2 = ")(princ y2)
> > (prompt "\nX3 = ")(princ x3)
> > (prompt "\nY3 = ")(princ y3)
> > (prompt "\nX4 = ")(princ x4)
> > (prompt "\nY4 = ")(princ y4)
> > (prompt "\nIntersection = ")(princ answerx)(princ answery)
> > (command "-text" sp1 "" "" "kip1")
> > (command "-text" ep1 "" "" "kpi2")
> > (command "-text" sp2 "" "" "kip3")
> > (command "-text" ep2 "" "" "kip4")
> > ) ; end of progn
> > (prompt "\nEntity selected is not a line!")
> > ) ; end of if
> > (princ)
> > ); end ll.lsp
> >
>
>