Jump to content

Polylines move several times in different directions


Recommended Posts

Posted (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 by martinle
Posted

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?

Posted

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

Posted

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 ?

Posted

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

Posted (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... :lol:

 

Strike that... since the program will ask for direction, then theres no need for the rectangle.

...(initially i thought of using closestpoint)...

Edited by pBe
thought about it..... then..
Posted

Hello pbe

And what would please the go?

(Defun c: ....

)

 

martin:(

Posted
Hello pbe

And 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 :)

Posted

Hello pbe!

 

Huaaaaaa:(:cry:

 

py pbe

Posted

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 :)

Posted

Hello pbe!

 

Acad Meldung: Fehlerhafte Zeichenfolge für ssget-Modus

(Incorrect string ssget mode)

 

Martin

Posted

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

:notworthy:

Posted

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 :beer:

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...