martinle Posted February 21, 2012 Posted February 21, 2012 (edited) Hello! My search in the forum was not successful. But maybe there is already a task for this Lisp? I know, this forum is not a request concert .... But it is the best in the world! I have the following problem: I have to move a lot of polylines as in my example of a starting point for a variable length. Those objects whose starting point should be set back further to their Rückspung shifted further to the outside. The goal of all objects on a page should be located on a line. Martin Plan.dwg Edited February 21, 2012 by martinle Quote
pBe Posted February 21, 2012 Posted February 21, 2012 Interesting request Martin, wish i have time to play around with it. Moving the objets wouldnt be a problem really, what i'm concern about is the selection process How would you go about selecting the objects? Quote
martinle Posted February 21, 2012 Author Posted February 21, 2012 Hello pbe! Thank you for your interest. The choice I would do so. The average polyline where the hatch is to select, and all would be shifted by a value to these adjacent polyline objects. Would that be feasible? Martin Quote
pBe Posted February 21, 2012 Posted February 21, 2012 Which means you need to select the adjacent polylines as well? To be on the clear: The white rectangles are existing: The rectangle mark "ED" will be copied once and move the next Are there instances where the "average" polyline is rotated ? Quote
martinle Posted February 21, 2012 Author Posted February 21, 2012 Hello pbe! Imagine it this way: The area of the hatch is my room. The red polyline that encloses the hatch is the wall. The walls are all up to 1,000 units but some other times also have another dimension. These walls I simply folded outwards. These walls will all but I must have moved to a particular unit (as shown in the example) to the outside. I just see that I've drawn a polyline at Pos EN wrong. Sorry. Have the plan updated. The wall is in the plan but have just any form. So more or less segments. The corners of this Polyolinie but always with radius 0 ie eckig.Wobei of the corner may be different. Martin Quote
pBe Posted February 21, 2012 Posted February 21, 2012 (edited) Okay. i think it can be done Here's how i'll approach it: Select the Hatch boundary Specify distance Specify height of room Vla-get-boundingbox hatch boundary Create a rectangle (height + distance) Highlight object to move one by one Enter option [up/Down/Left/Right] Select option for current highlighted object..... BAM!! Erase Rectangle but thats just me... Strike that... since the program will ask for direction, then theres no need for the rectangle. ...(initially i thought of using closestpoint)... Edited February 21, 2012 by pBe thought about it..... then.. Quote
martinle Posted February 21, 2012 Author Posted February 21, 2012 Hello pbe And what would please the go? (Defun c: .... ) martin:( Quote
pBe Posted February 21, 2012 Posted February 21, 2012 Hello pbeAnd what would please the go? (Defun c: .... ) martin:( Formulating the code in my head.... and i'm sure somebody else is doing the same, be patient martin Quote
pBe Posted February 21, 2012 Posted February 21, 2012 Wait for it...... Like i said... be patient... Quote
pBe Posted February 21, 2012 Posted February 21, 2012 draft (Defun C:test ( / def bnd dir ave ss refpt mn mx e opt o) (vl-load-com) (defun def (cv msg) (cond ((getdist (strcat msg (if (numberp cv) (strcat " <" (rtos cv 2 4) ">: ") ": " )))) (cv)) ) (defun bnd (e / mn mx) (vla-getboundingbox (vlax-ename->vla-object e) 'mn 'mx) (list (vlax-safearray->list mn) (vlax-safearray->list mx))) (setq dir '("U" (cadr o) (list (car (cadr o))(+ (cadr mx) dist ht)) "D" (car o) (list (car (car o))(- (cadr mn) ht dist)) "L" (car o) (list (- (car mn) ht dist) (cadr (car o))) "R" (cadr o) (list (+ (car mx) ht dist)(cadr (cadr o))) ) ) (if (and (setq ave (ssget ":S:E" '((0 . "LWPOLYLINE")))) (setq dist (def dist "\nEnter Distance: ")) (setq ht (def ht "\nEnter room Height: ")) (setq ss (ssget ":L" '((0 . "LWPOLYLINE")))) (setq refpt (bnd (ssname ave 0))) (setq mn (car refpt) mx (cadr refpt))) (repeat (sslength ss) (setq e (ssname ss 0)) (redraw e 3) (initget 1 "U D L R") (setq opt (getkword "\nSelect Direction [up/Down/Left/Right]: ")) (setq o (bnd e) r (member opt dir)) (vla-move (vlax-ename->vla-object e) (vlax-3d-point (eval (cadr r))) (vlax-3d-point (eval (caddr r)) )) (redraw e 4) (ssdel e ss))) (princ) ) Try it for now.. run out of time Quote
martinle Posted February 21, 2012 Author Posted February 21, 2012 Hello pbe! Acad Meldung: Fehlerhafte Zeichenfolge für ssget-Modus (Incorrect string ssget mode) Martin Quote
Lee Mac Posted February 21, 2012 Posted February 21, 2012 Change: :S:E And :L to: _:S:E and _:L Quote
martinle Posted February 21, 2012 Author Posted February 21, 2012 Hi Lee! Man my chair is all wet! Ha ha! It works just great! Thank pbe and Thank you Lee You have helped me a lot! Martin Quote
Lee Mac Posted February 21, 2012 Posted February 21, 2012 All credit to pBe, I just accounted for language variation. Quote
pBe Posted February 22, 2012 Posted February 22, 2012 Thank pbe You are welcome, glad i could help All credit to pBe, I just accounted for language variation. You have helped us here more than you know Lee, appreciate it a lot. Cheers 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.