Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/17/2022 in all areas

  1. I saw on another forum a request for a 3" x 24" herringbone hatch. I thought I would post one, (keeps the brain going!!) *Herringbone3x24 45,0,0,3,3,27,-21 135,2.121320344,2.121320344,3,-3,27,-21 *eldon may 2022 Herringbone3x24.pat
    3 points
  2. Thanks Steven for your input. Sorry for the late reply. I changed the Cons 90 from 4 to 6 and it worked! Although only for the horizontal rectangle in that particular sequence . I just need to change the sequence of points to make it work in the vertical (because the Mid points pt5 and pt6 are now on the opposite sides of the rectangle so results get weird). If I get both sequences working, I will move them under their respective sections of my Midpoints IF statements. They should work then if rectangle drawn horizontal or vertical... Hopefully Thanks for your help! If I get it all working, will post the final results for others who may be interested... FYI: This code is actually a snippet in a much larger routine I have. In that one I have a variable for the Area of the rectangle to control the arc so the arc changes proportionally with the size of the rectangle. I also delete the rectangle at the end as well. I just didn't want to bog down what I was posting with extra code... Thanks again !
    1 point
  3. Have you tried your LWPolyline Ent Make Cons 90 to be 6 if you are drawing 6 arcs? (Edit: I think there is a list out there somewhere what all the codes mean for each object type, for a polyline you need to say how many elements it has, in this case cons 90 does that) I'd also put in an (entdel (entlast)) after you calculate Pt4 to remove the temporary? rectangle you draw Last comment for you to look at, this works OK on my CAD machine on larger rectangles (say 100x75), but on a smaller rectangle (10 x 5) the arc is on the outside of the rectangle
    1 point
  4. Mhupp "Also this depends on the direction the polyline is drawn." Pick near end you then check the two end points compared to the pick point and if necessary just reverse the line or pline. There is a problem the straight line is 50.000000 the curved line is 49.9997023888379 so they are different. Given the diff 0.001 in say m or mm its within tolerance for the fudge I have done. Only effects the last point. ; copys blocks from a pline to another (defun C:WOW (/ lendist ent blk blksc obj obj2 path pt pti d1 d2 ss) (vl-load-com) (setq oldsnap (getvar 'osmode)) (setvar 'osmode 0) (setq ent (entget (car (entsel "\nSelect Block: "))) blk (cdr (assoc 2 ent)) blksc (cdr (assoc 41 ent)) ) (setq ent (entsel "\nSelect line: ") pt (cadr ent) obj (vlax-ename->vla-object (car ent)) ) (setq obj2 (vlax-ename->vla-object (car (entsel "\nSelect Path: ")))) (setq len (vla-get-length obj2)) (setq end (vlax-curve-getendpoint Obj) start (vlax-curve-getstartpoint Obj) d1 (distance pt end) d2 (distance pt start) ) (if (< d1 d2) (command "pedit" ent "R" "") ) (setq ss (ssget (list (cons 0 "Insert")(cons 2 blk)))) (repeat (setq x (sslength ss)) (setq pti(cdr (assoc 10 (entget (ssname ss (setq x (1- x))))))) (setq dist (vlax-curve-getdistatpoint obj pti)) (setq pt (vlax-curve-getpointatdist obj2 dist )) (if (= pt nil) (command "-Insert" blk (vlax-curve-getendpoint Obj2) blksc "" 0) (command "-Insert" blk pt blksc "" 0) ) ) (setvar 'osmode oldsnap) (princ) ) (c:WOW)
    1 point
  5. Maybe someone can figure out how to make a list of distances by selecting the blocks but this is semi manual. Also this depends on the direction the polyline is drawn. (defun C:foo (/ mspace dist ent blk obj path pt) (vl-load-com) (setq mspace (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))) dist 0.0 blk (cdr (assoc 2 (entget (car (entsel "\nSelect Block: "))))) obj (vlax-ename->vla-object (car (entsel "\nSelect Path: "))) path (vla-get-length obj) ) (while (< dist path) (setq dist (+ dist (getdist))) (setq pt (vlax-curve-getpointatdist obj (+ (vlax-curve-getdistatparam obj (vlax-curve-getstartparam obj)) dist))) (vlax-invoke mspace 'InsertBlock pt blk 1 1 1 0) ) (princ) )
    1 point
×
×
  • Create New...