9/25/2023 0 Comments Librecad array along pathTry just this in place of all the quoted portion above : Also, I think you have an extra Enter at the end. And since you want the spacing to be positive in any case, you need the absolute value of that, whether the cosine is positive or negative, which means you can figure the angle one way regardless of which is the 'inspt' end. You need it in radians to get its cosine to figure the hypotenuse distance. There's no point I can see in converting the angle to degrees. If I chose 15 the true distance 14.7403 because of the angle. (setvar "CMDECHO" calculation for the spacing is not correct. (command "._arraypath" ent "" sel "I" dist1 "F" "" "") I've made a modification to the lisp but the calculation for the spacing is not correct. (if (< (distance startpt pickpt) (distance endpt pickpt))Īng (* (/ (angle inspt (vlax-curve-getPointAtDist path 0.001)) pi) 180))Īng (* (/ (angle (vlax-curve-getPointAtDist path (- len 0.001)) inspt) pi 180))) Len (vlax-curve-getDistAtParam path (vlax-curve-getEndParam path)) (setq sel (entsel "\nSelect Array Path: ")) (setq dist1 (getdist "\nEnter Distance Between Objects: ")) (if (and (setq ent (car(entsel "\nSelect Object to Array: "))) (defun c:ARP (/ ANG CUR_LAY DIST1 ENDPT INSPT LEN PATH PICKPT SEL STARTPT) (or post a sample drawing with explanation.) Num (getint "\nSpecify Number of Array Iteams: ") P2 (getpoint p1 "\nSpecify End Point of Line/Path (To get Angle and Direction): ")ĭst (getdist "\nSpecify Offset Distance (Horizontal) Between Objects: ") (setq p1 (getpoint "\nSpecify First Point of Line/Path (To get Angle and Direction): ") (while (= (setq ent (car(entsel "\nSelect Object for Array: "))) nil)) (defun c:arh (/ ent p1 p2 ang num dst dst1) Try this.(By this code you can control " Path Angle" and " Horizontal Distance" only not " Vertical Distance") The below image shows the spacing should have been 15'. I've tried the Div/Mea command but it wont take the path angle into account when measuring the distance between objects. I've tried using Polar Array and it seems to do what i want, but I cant control the spacing between blocks as it always varies. My issue is that the path angle is always different and i need to be able to control the spacing between blocks. I've been trying to write a lisp, with very limited knowledge, to array a block along a path.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |