rkent Posted August 15, 2011 Posted August 15, 2011 Anyone ever come up with a good way to start a line at one of the 45 degree angles of a circle block? Easy to snap to quadrants or center. Thanks for any ideas. Just use OTRACKing on, with OSNAP set to center and intersection, and finally Polar on with 45 degree angles, or set to any angle needed. Acquire the center of the circle in the block, move the cursor to the edge of the circle, pick when you are there, proceed from there. Quote
alanjt Posted August 15, 2011 Posted August 15, 2011 Thanks Allen. I tried out your LFC command. Unfortunately, the LFC.lsp command you wrote seems to have the same limitation as the QS.lsp command referenced above. It will not select a circle nested inside of a block. You are a coding machine though. Then we'll cheat... (defun c:LFC (/ *error* circle data temp ang) ;; Line From Circle ;; Alan J. Thompson, 08.15.11 (vl-load-com) (defun *error* (msg) (and temp (entdel temp)) (if (and msg (not (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*QUIT*,"))) (princ (strcat "\nError: " msg)) ) ) (if (and (setq circle (nentselp "\nSelect circle: ")) (eq (cdr (assoc 0 (setq data (entget (car circle))))) "CIRCLE") (cond ((eq (length circle) 2) (setq circle (car circle))) (T (vla-transformby (vlax-ename->vla-object (setq temp (entmakex data))) (vlax-tmatrix (caddr circle)) ) (setq data (entget (setq circle temp))) ) ) (setq ang (getangle (trans (cdr (assoc 10 data)) 0 1) "\nSpecify angle for line: ")) ) (vl-cmdf "_.line" "_non" (trans (vlax-curve-getPointAtDist circle (* ang (cdr (assoc 40 data)))) 0 1) (strcat "<" (angtos (if (zerop (getvar 'WORLDUCS)) (- ang (angle '(0. 0. 0.) (trans (getvar 'UCSXDIR) 0 (trans '(0. 0. 1.) 1 0 T) T))) ang ) (getvar 'AUNITS) 4 ) ) PAUSE ) ) (*error* nil) (princ) ) Quote
Edgtrimmer Posted August 15, 2011 Author Posted August 15, 2011 Thanks, I have some dynamic blocks like that. That's certainly an option. Quote
nestly Posted August 15, 2011 Posted August 15, 2011 What rkent said. Polar tracking 45degrees.... done. Quote
Edgtrimmer Posted August 16, 2011 Author Posted August 16, 2011 Acuatlly, I use polar tracking almost all the time. It gives you the 45 degrees but not the exact starting point on the circle unless there is some trick I haven't come up with to get from the center of the circle to the point at 45 degrees on the circle. Thank you for all of your input. It is appreciated. Quote
alanjt Posted August 16, 2011 Posted August 16, 2011 Edgtrimmer, did you try the second routine I posted? Quote
nestly Posted August 16, 2011 Posted August 16, 2011 Acuatlly, I use polar tracking almost all the time. It gives you the 45 degrees but not the exact starting point on the circle unless there is some trick I haven't come up with to get from the center of the circle to the point at 45 degrees on the circle. Thank you for all of your input. It is appreciated. You'll need to have "Center" and "Intersection" OSnaps turned on. Basically, you're snapping the intersection of the tracking line and the circle (notice the "Intersection" osnap marker in the video http://screencast.com/t/IvxE30hKo Quote
Edgtrimmer Posted August 16, 2011 Author Posted August 16, 2011 The last post I saw with code was the LFC.lsp command you wrote. I did try that one. I works perfectly on a plain circle but doesn't recognize a circle that is nested inside of a block. That was the problem I had with the QS.lsp routine found on the Cadalyst website. Nice routine though. Quote
alanjt Posted August 16, 2011 Posted August 16, 2011 The last post I saw with code was the LFC.lsp command you wrote. I did try that one. I works perfectly on a plain circle but doesn't recognize a circle that is nested inside of a block. That was the problem I had with the QS.lsp routine found on the Cadalyst website. Nice routine though. Try the second one I posted. Quote
Edgtrimmer Posted August 16, 2011 Author Posted August 16, 2011 Yes! I thought there should be something like that I could be doing. I just didn't think center and intersection would work but it obviously does. Thanks, I shall have to practice that technique. Question answered! Quote
Edgtrimmer Posted August 16, 2011 Author Posted August 16, 2011 I take it back. I tried the center-intersection technique and moving the cursor form the center along a 45 degree angle, the angle lost the 45 degrees once I intersected the circle. If you draw a line using your method, are you sure the line measures exactly 45 degrees from the circl center to its start point? Quote
Edgtrimmer Posted August 16, 2011 Author Posted August 16, 2011 I guess I didn't see the second posting of the LFC.lsp. I just pasted that code into Notepad and saved and ran it and yes it does work with a block containing a circle now. That's perfect. Thank you! Quote
alanjt Posted August 16, 2011 Posted August 16, 2011 I guess I didn't see the second posting of the LFC.lsp. I just pasted that code into Notepad and saved and ran it and yes it does work with a block containing a circle now. That's perfect. Thank you! No worries. You're welcome. It was a bit of fun for a dull afternoon. Quote
nestly Posted August 16, 2011 Posted August 16, 2011 If you draw a line using your method, are you sure the line measures exactly 45 degrees from the circl center to its start point? Yes . http://www.screencast.com/t/kDSxGnZjYeld Quote
Edgtrimmer Posted August 16, 2011 Author Posted August 16, 2011 Okay, I see where I was going wrong. I had additional running osnaps turned on. I had nearest on also, so that was why my cursor wasn't limited to the 45 degree intersection snap. Thank you very much for your help and for your patience. That is a good simple method to do what I want. I now have two nice ways to do what I want. Thanks to all! Quote
nestly Posted August 16, 2011 Posted August 16, 2011 I had additional running osnaps turned on. I had nearest on also, so that was why my cursor wasn't limited to the 45 degree intersection snap. Sorry about that, I never have NEAREST running and I didn't even consider that the NEAREST OSnap would have precedence over Osnap tracking. Quote
Edgtrimmer Posted August 17, 2011 Author Posted August 17, 2011 Thanks for the suggestion, but setting snapang to 45 doesn't let me snap to the circle block with a line 45 degrees out from the circle center though. I use polar tracking to easily draw lines at 45 degrees. Most of my lines, like most users are at increments of 90 degrees, so polar tracking is much easier way to draw 45 degrees lines than changing my snap angle back and forth from 0 to 45 degrees. The 2 solutions I got, one from alanjt (nifty lisp command LFC.lsp) and the trick using running snap with polar tracking along with object snap tracking have solved the issue for me. Quote
troggarf Posted August 20, 2011 Posted August 20, 2011 Start Line command Use the Center OSNAP or use the snap override (hold SHIFT + C) to start the line With Dynamic input turned on - hit the TAB button to set the angle. After you enter 45 hit TAB again to specify the length or just place the line then trim where it intersects the circle. then start a new line from the line + circle intersection and use the same dynamic input feature. After learning this dynamic input technique, I have not used the polar function in over a year... The attached picture is supposed to be an animated GIF but is aint very animated... Quote
Edgtrimmer Posted August 22, 2011 Author Posted August 22, 2011 Thank you for your input. Before the help I received in this forum, I had been doing something very similar to what you do. After starting the line command, I would right click my mouse to pop up object snaps and then hit the letter 'c' for center to pick the circle center. I have gotten used to polar tracking, so drawing the 45 degree angle from the circle center was no problem. Finally, I would trim the line from inside the circle like you do. Using object snap tracking and polar tracking, I can just hover over the circle, then its center to light-up the center snap symbol, then move approx. 45 degrees toward circle until the intersection symbol lights up and pick the circle to start my line at 45 degrees from circle center at the intersection of the circle (can't have 'nearest' running osnap on). Takes a little practice but it eliminates any trimming after drawing the line. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.