Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/12/2019 in all areas

  1. Hey guys, Sorry for the vague title, didn't really know how best to name this thread... or describe my question, for that matter. I have a couple of elements (3DSOLID and ARC/CIRCLE - within block) that I would like to move onto a line, at the tangent of the ARC/CIRCLE. I only wish to move them horizontally, in the X axis. Please see screen shot below and CAD file attached. I have been drawing a line from centre of ARC/CIRCLE, perpendicular to the line, then drawing a horizontal line at the inter or the 1st line and the ARC... this method does give me the desired result, but is a bit time consuming. I will need to perform this task approximately 1200 times. I am wondering if anyone knows of the routine or command that will allow me to pick the ARC and objects and then move them (in current view X only) onto the tangent line? I have done a bit of digging in Google, and there are a few peeps asking a similar question, but I haven't found an 'automated' method just yet. Thanks a lot for any help guys. MOVE X at TAN.dwg
    1 point
  2. (to me) It's a bit of problem that the entities are not drawn in WCS. I can do it for my dwg, maybe somebody can adapt it to work for yours Command MAT (for Move Arc Tangent) select the arc select the block again anywhere (this is another ToDo: extract the parent...) select the line ;; https://www.cadtutor.net/forum/topic/18257-entmake-functions/ (defun Line (p1 p2) (entmakex (list (cons 0 "LINE") (cons 10 p1) (cons 11 p2))) ) (defun xLine (pt vec) (entmakex (list (cons 0 "XLINE") (cons 100 "AcDbEntity") (cons 100 "AcDbXline") (cons 10 pt) (cons 11 vec))) ) (defun dArc (cen rad sAng eAng) (entmakex (list (cons 0 "ARC") (cons 10 cen) (cons 40 rad) (cons 50 sAng) (cons 51 eAng)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Intersections - Lee Mac ;; Returns a list of all points of intersection between two objects ;; for the given intersection mode. ;; ob1,ob2 - [vla] VLA-Objects ;; mod - [int] acextendoption enum of intersectwith method (defun LM:intersections ( ob1 ob2 mod / lst rtn ) (if (and (vlax-method-applicable-p ob1 'intersectwith) (vlax-method-applicable-p ob2 'intersectwith) (setq lst (vlax-invoke ob1 'intersectwith ob2 mod)) ) (repeat (/ (length lst) 3) (setq rtn (cons (list (car lst) (cadr lst) (caddr lst)) rtn) lst (cdddr lst) ) ) ) (reverse rtn) ) (vl-load-com) (defun c:mat ( / arc arc2 parent l1 c1 s e r bi p1 sloped hor lst p2 p3) (setq arc (nentsel "\nSelect Arc")) ;;(setq parent (cdr (assoc 330 (entget (car arc))))) (setq parent (entsel "\nSelect Block")) (setq l1 (entsel "\nSelect Line")) ;; center/start/end/radius of the Arc inside block (edit) ;; we will copy/paste the arc outside of the block (setq c1 (cdr (assoc 10 (entget (car arc))))) (setq s (cdr (assoc 50 (entget (car arc))))) (setq e (cdr (assoc 51 (entget (car arc))))) (setq r (cdr (assoc 40 (entget (car arc))))) ;; insert point of the block (setq bi (cdr (assoc 10 (entget (car parent))))) ;; sum of both gives you the center outside the block (setq c1 (list (+ (nth 0 c1) (nth 0 bi)) (+ (nth 1 c1) (nth 1 bi)) )) ;; copy the arc (setq arc2 (dArc c1 r s e)) ;; p1: closest point on the line to the center of the arc (perpendicular) (setq p1 (vlax-curve-getClosestPointTo (car l1) c1)) ;; draw a sloped line (setq sloped (Line c1 p1)) ;; find the intersection of the arc / sloped line (setq lst (LM:intersections (vlax-ename->vla-object sloped) (vlax-ename->vla-object arc2) acextendnone)) (setq p2 (nth 0 lst)) ;; draw a horizontal XLine (setq hor (xLine p2 (list 1.0 0.0) )) ;; find the intersection of the horizontal xLine / l1 (setq lst (LM:intersections (vlax-ename->vla-object hor) (vlax-ename->vla-object (car l1)) acextendnone)) (setq p3 (nth 0 lst)) ;; move arc to p3 (vla-move (vlax-ename->vla-object (car parent)) (vlax-3d-point p2)(vlax-3d-point p3)) ;; delete temporary items Line, xLine, Arc (entdel sloped) (entdel hor) (entdel arc2) ) MAT.dwg
    1 point
  3. Hi to all, I don't know if this thread was finished, but just one suggest, It's possible to draw a 3D Polyline (3DPOLY) and extrude it after (option path), I normally use this way, similar to the Bigal's post.
    1 point
  4. I draw individual center lines (each pipe and elbow) then sweep a circle (or region) of the pipes.
    1 point
  5. Sir Thank you so much for your routine... I edit it for my Filter and it works! Its long, i know, but its easy! i used excel and mostly concatenation and COPY>TRANSPOSE... Heres what i came up with: (defun LayFilterAdd (/ collection names) (setq names (list "")) (if (not (vl-catch-all-error-p (setq collection (vl-catch-all-apply (function (lambda () (vla-item (vla-getextensiondictionary (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))) "ACAD_LAYERFILTERS"))) )))) (vlax-for item collection (setq names (cons (vla-get-name item) names)))) names (or(member "670 LEVEL" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"*CONTOUR_EL670*\" or NAME==\"*CONTOUR_EL672*\" or NAME==\"*CONTOUR_EL674*\" or NAME==\"*CONTOUR_EL676*\" or NAME==\"*CONTOUR_EL678*\" or NAME==\"*CONTOUR_EL680*\" or NAME==\"*CONTOUR_EL682*\" or NAME==\"*CONTOUR_EL684*\" or NAME==\"*CONTOUR_EL686*\" or NAME==\"*CONTOUR_EL688*\" or NAME==\"*CONTOUR_EL690*\" or NAME==\"*CONTOUR_EL692*\" or NAME==\"*CONTOUR_EL694*\" or NAME==\"*CONTOUR_EL696*\" or NAME==\"*CONTOUR_EL698*\" or NAME==\"*CONTOUR_EL700*\" or NAME==\"*CONTOUR_EL702*\" or NAME==\"*CONTOUR_EL704*\" or NAME==\"*CONTOUR_EL706*\"" "670 LEVEL" "X" nil)) (or(member "700 LEVEL" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"*CONTOUR_EL710*\" or NAME==\"*CONTOUR_EL712*\" or NAME==\"*CONTOUR_EL714*\" or NAME==\"*CONTOUR_EL716*\" or NAME==\"*CONTOUR_EL718*\" or NAME==\"*CONTOUR_EL720*\" or NAME==\"*CONTOUR_EL722*\" or NAME==\"*CONTOUR_EL724*\" or NAME==\"*CONTOUR_EL726*\" or NAME==\"*CONTOUR_EL728*\" or NAME==\"*CONTOUR_EL730*\" or NAME==\"*CONTOUR_EL732*\" or NAME==\"*CONTOUR_EL734*\" or NAME==\"*CONTOUR_EL736*\" or NAME==\"*CONTOUR_EL738*\" or NAME==\"*CONTOUR_EL740*\" or NAME==\"*CONTOUR_EL742*\" or NAME==\"*CONTOUR_EL744*\" or NAME==\"*CONTOUR_EL746*\" or NAME==\"*CONTOUR_EL748*\" or NAME==\"*CONTOUR_EL750*\" or NAME==\"*CONTOUR_EL752*\" or NAME==\"*CONTOUR_EL754*\" or NAME==\"*CONTOUR_EL756*\" or NAME==\"*CONTOUR_EL758*\" or NAME==\"*CONTOUR_EL760*\" or NAME==\"*CONTOUR_EL762*\" or NAME==\"*CONTOUR_EL764*\" or NAME==\"*CONTOUR_EL766*\" or NAME==\"*CONTOUR_EL768*\"" "700 LEVEL" "X" nil)) (or(member "750 LEVEL" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"*CONTOUR_EL770*\" or NAME==\"*CONTOUR_EL772*\" or NAME==\"*CONTOUR_EL774*\" or NAME==\"*CONTOUR_EL776*\" or NAME==\"*CONTOUR_EL778*\" or NAME==\"*CONTOUR_EL780*\" or NAME==\"*CONTOUR_EL782*\" or NAME==\"*CONTOUR_EL784*\" or NAME==\"*CONTOUR_EL786*\" or NAME==\"*CONTOUR_EL788*\" or NAME==\"*CONTOUR_EL790*\" or NAME==\"*CONTOUR_EL792*\" or NAME==\"*CONTOUR_EL794*\" or NAME==\"*CONTOUR_EL796*\" or NAME==\"*CONTOUR_EL798*\" or NAME==\"*CONTOUR_EL800*\" or NAME==\"*CONTOUR_EL802*\" or NAME==\"*CONTOUR_EL804*\" or NAME==\"*CONTOUR_EL806*\" or NAME==\"*CONTOUR_EL808*\"" "750 LEVEL" "X" nil)) (or(member "800 LEVEL" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"*CONTOUR_EL810*\" or NAME==\"*CONTOUR_EL812*\" or NAME==\"*CONTOUR_EL814*\" or NAME==\"*CONTOUR_EL816*\" or NAME==\"*CONTOUR_EL818*\" or NAME==\"*CONTOUR_EL820*\" or NAME==\"*CONTOUR_EL822*\" or NAME==\"*CONTOUR_EL824*\" or NAME==\"*CONTOUR_EL826*\" or NAME==\"*CONTOUR_EL828*\" or NAME==\"*CONTOUR_EL830*\" or NAME==\"*CONTOUR_EL832*\" or NAME==\"*CONTOUR_EL834*\" or NAME==\"*CONTOUR_EL836*\" or NAME==\"*CONTOUR_EL838*\" or NAME==\"*CONTOUR_EL840*\" or NAME==\"*CONTOUR_EL842*\" or NAME==\"*CONTOUR_EL844*\" or NAME==\"*CONTOUR_EL846*\" or NAME==\"*CONTOUR_EL848*\" or NAME==\"*CONTOUR_EL850*\" or NAME==\"*CONTOUR_EL852*\" or NAME==\"*CONTOUR_EL854*\" or NAME==\"*CONTOUR_EL856*\" or NAME==\"*CONTOUR_EL858*\" or NAME==\"*CONTOUR_EL860*\" or NAME==\"*CONTOUR_EL862*\" or NAME==\"*CONTOUR_EL864*\" or NAME==\"*CONTOUR_EL866*\" or NAME==\"*CONTOUR_EL868*\"" "800 LEVEL" "X" nil)) (or(member "850 LEVEL" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"*CONTOUR_EL870*\" or NAME==\"*CONTOUR_EL872*\" or NAME==\"*CONTOUR_EL874*\" or NAME==\"*CONTOUR_EL876*\" or NAME==\"*CONTOUR_EL878*\" or NAME==\"*CONTOUR_EL880*\" or NAME==\"*CONTOUR_EL882*\" or NAME==\"*CONTOUR_EL884*\" or NAME==\"*CONTOUR_EL886*\" or NAME==\"*CONTOUR_EL888*\" or NAME==\"*CONTOUR_EL890*\" or NAME==\"*CONTOUR_EL892*\" or NAME==\"*CONTOUR_EL894*\" or NAME==\"*CONTOUR_EL896*\" or NAME==\"*CONTOUR_EL898*\" or NAME==\"*CONTOUR_EL900*\" or NAME==\"*CONTOUR_EL902*\" or NAME==\"*CONTOUR_EL904*\" or NAME==\"*CONTOUR_EL906*\" or NAME==\"*CONTOUR_EL908*\"" "850 LEVEL" "X" nil)) (or(member "900 LEVEL" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"*CONTOUR_EL910*\" or NAME==\"*CONTOUR_EL912*\" or NAME==\"*CONTOUR_EL914*\" or NAME==\"*CONTOUR_EL916*\" or NAME==\"*CONTOUR_EL918*\" or NAME==\"*CONTOUR_EL920*\" or NAME==\"*CONTOUR_EL922*\" or NAME==\"*CONTOUR_EL924*\" or NAME==\"*CONTOUR_EL926*\" or NAME==\"*CONTOUR_EL928*\" or NAME==\"*CONTOUR_EL930*\" or NAME==\"*CONTOUR_EL932*\" or NAME==\"*CONTOUR_EL934*\" or NAME==\"*CONTOUR_EL936*\" or NAME==\"*CONTOUR_EL938*\" or NAME==\"*CONTOUR_EL940*\" or NAME==\"*CONTOUR_EL942*\" or NAME==\"*CONTOUR_EL944*\" or NAME==\"*CONTOUR_EL946*\" or NAME==\"*CONTOUR_EL948*\" or NAME==\"*CONTOUR_EL950*\" or NAME==\"*CONTOUR_EL952*\" or NAME==\"*CONTOUR_EL954*\" or NAME==\"*CONTOUR_EL956*\" or NAME==\"*CONTOUR_EL958*\" or NAME==\"*CONTOUR_EL960*\"" "900 LEVEL" "X" nil)) (or(member "950 LEVEL" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"*CONTOUR_EL962*\" or NAME==\"*CONTOUR_EL964*\" or NAME==\"*CONTOUR_EL966*\" or NAME==\"*CONTOUR_EL968*\" or NAME==\"*CONTOUR_EL970*\" or NAME==\"*CONTOUR_EL972*\" or NAME==\"*CONTOUR_EL974*\" or NAME==\"*CONTOUR_EL976*\" or NAME==\"*CONTOUR_EL978*\" or NAME==\"*CONTOUR_EL980*\" or NAME==\"*CONTOUR_EL982*\" or NAME==\"*CONTOUR_EL984*\" or NAME==\"*CONTOUR_EL986*\" or NAME==\"*CONTOUR_EL988*\" or NAME==\"*CONTOUR_EL990*\" or NAME==\"*CONTOUR_EL992*\" or NAME==\"*CONTOUR_EL994*\" or NAME==\"*CONTOUR_EL996*\" or NAME==\"*CONTOUR_EL998*\" or NAME==\"*CONTOUR_EL1000*\" or NAME==\"*CONTOUR_EL1002*\" or NAME==\"*CONTOUR_EL1004*\" or NAME==\"*CONTOUR_EL1006*\" or NAME==\"*CONTOUR_EL1008*\" or NAME==\"*CONTOUR_EL1010*\" or NAME==\"*CONTOUR_EL1012*\" or NAME==\"*CONTOUR_EL1014*\" or NAME==\"*CONTOUR_EL1016*\" or NAME==\"*CONTOUR_EL1018*\"" "950 LEVEL" "X" nil)) (or(member "1000 LEVEL" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"*CONTOUR_EL1020*\" or NAME==\"*CONTOUR_EL1022*\" or NAME==\"*CONTOUR_EL1024*\" or NAME==\"*CONTOUR_EL1026*\" or NAME==\"*CONTOUR_EL1028*\" or NAME==\"*CONTOUR_EL1030*\" or NAME==\"*CONTOUR_EL1032*\" or NAME==\"*CONTOUR_EL1034*\" or NAME==\"*CONTOUR_EL1036*\" or NAME==\"*CONTOUR_EL1038*\" or NAME==\"*CONTOUR_EL1040*\" or NAME==\"*CONTOUR_EL1042*\" or NAME==\"*CONTOUR_EL1044*\" or NAME==\"*CONTOUR_EL1046*\" or NAME==\"*CONTOUR_EL1048*\" or NAME==\"*CONTOUR_EL1050*\" or NAME==\"*CONTOUR_EL1052*\" or NAME==\"*CONTOUR_EL1054*\" or NAME==\"*CONTOUR_EL1056*\" or NAME==\"*CONTOUR_EL1058*\" or NAME==\"*CONTOUR_EL1060*\" or NAME==\"*CONTOUR_EL1062*\" or NAME==\"*CONTOUR_EL1064*\" or NAME==\"*CONTOUR_EL1066*\"" "1000 LEVEL" "X" nil)) (or(member "1070 LEVEL" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"*CONTOUR_EL1070*\" or NAME==\"*CONTOUR_EL1072*\" or NAME==\"*CONTOUR_EL1074*\" or NAME==\"*CONTOUR_EL1076*\" or NAME==\"*CONTOUR_EL1078*\" or NAME==\"*CONTOUR_EL1080*\" or NAME==\"*CONTOUR_EL1082*\" or NAME==\"*CONTOUR_EL1084*\" or NAME==\"*CONTOUR_EL1086*\" or NAME==\"*CONTOUR_EL1088*\" or NAME==\"*CONTOUR_EL1090*\" or NAME==\"*CONTOUR_EL1092*\" or NAME==\"*CONTOUR_EL1094*\" or NAME==\"*CONTOUR_EL1096*\" or NAME==\"*CONTOUR_EL1098*\" or NAME==\"*CONTOUR_EL1100*\" or NAME==\"*CONTOUR_EL1102*\" or NAME==\"*CONTOUR_EL1104*\" or NAME==\"*CONTOUR_EL1106*\" or NAME==\"*CONTOUR_EL1108*\"" "1070 LEVEL" "X" nil)) (or(member "1100 LEVEL" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"*CONTOUR_EL1110*\" or NAME==\"*CONTOUR_EL1112*\" or NAME==\"*CONTOUR_EL1114*\" or NAME==\"*CONTOUR_EL1116*\" or NAME==\"*CONTOUR_EL1118*\" or NAME==\"*CONTOUR_EL1120*\" or NAME==\"*CONTOUR_EL1122*\" or NAME==\"*CONTOUR_EL1124*\" or NAME==\"*CONTOUR_EL1126*\" or NAME==\"*CONTOUR_EL1128*\" or NAME==\"*CONTOUR_EL1130*\" or NAME==\"*CONTOUR_EL1132*\" or NAME==\"*CONTOUR_EL1134*\" or NAME==\"*CONTOUR_EL1136*\" or NAME==\"*CONTOUR_EL1138*\" or NAME==\"*CONTOUR_EL1140*\" or NAME==\"*CONTOUR_EL1142*\" or NAME==\"*CONTOUR_EL1144*\" or NAME==\"*CONTOUR_EL1146*\" or NAME==\"*CONTOUR_EL1148*\" or NAME==\"*CONTOUR_EL1150*\" or NAME==\"*CONTOUR_EL1152*\" or NAME==\"*CONTOUR_EL1154*\" or NAME==\"*CONTOUR_EL1156*\" or NAME==\"*CONTOUR_EL1158*\" or NAME==\"*CONTOUR_EL1160*\" or NAME==\"*CONTOUR_EL1162*\" or NAME==\"*CONTOUR_EL1164*\" or NAME==\"*CONTOUR_EL1166*\" or NAME==\"*CONTOUR_EL1168*\"" "1100 LEVEL" "X" nil)) (or(member "1150 LEVEL" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"*CONTOUR_EL1170*\" or NAME==\"*CONTOUR_EL1172*\" or NAME==\"*CONTOUR_EL1174*\" or NAME==\"*CONTOUR_EL1176*\" or NAME==\"*CONTOUR_EL1178*\" or NAME==\"*CONTOUR_EL1180*\" or NAME==\"*CONTOUR_EL1182*\" or NAME==\"*CONTOUR_EL1184*\" or NAME==\"*CONTOUR_EL1186*\" or NAME==\"*CONTOUR_EL1188*\" or NAME==\"*CONTOUR_EL1190*\" or NAME==\"*CONTOUR_EL1192*\" or NAME==\"*CONTOUR_EL1194*\" or NAME==\"*CONTOUR_EL1196*\" or NAME==\"*CONTOUR_EL1198*\" or NAME==\"*CONTOUR_EL1200*\" or NAME==\"*CONTOUR_EL1202*\" or NAME==\"*CONTOUR_EL1204*\" or NAME==\"*CONTOUR_EL1206*\" or NAME==\"*CONTOUR_EL1208*\" or NAME==\"*CONTOUR_EL1210*\" or NAME==\"*CONTOUR_EL1212*\" or NAME==\"*CONTOUR_EL1214*\" or NAME==\"*CONTOUR_EL1216*\" or NAME==\"*CONTOUR_EL1218*\" or NAME==\"*CONTOUR_EL1220*\" or NAME==\"*CONTOUR_EL1222*\" or NAME==\"*CONTOUR_EL1224*\" or NAME==\"*CONTOUR_EL1226*\" or NAME==\"*CONTOUR_EL1228*\" or NAME==\"*CONTOUR_EL1230*\"" "1150 LEVEL" "X" nil)) (princ "Layer Filter Names » ")(princ names) (princ "\nSave, close and reopen the DWT or DWG for the Filters to be put into alphabetical order.") (princ) ); function (LayFilterAdd)
    1 point
  6. Thought as I dont do pipes normally using 1st principles of solids but very slow, the way to go is like Maratovich and Remark.
    1 point
×
×
  • Create New...