Jump to content

Lisp For Mirror selected objectes only


pvsvprasad

Recommended Posts

Dear Masters,

 

I need mirror of selected objects with reference to X-X axis. in my sample drawing i have selected all objects excluding blue circles. "please find after mirror drawing" and kindly share suitable lisp.

 

Thanking you all,

With best regards.

Before Mirror.dwg

After Mirror drawing.dwg

Edited by pvsvprasad
Link to comment
Share on other sites

Why do you need a lisp routine to mirror all the circles that are not blue?

 

Why are most of your objects on the Defpoints layer? You do realize a layer can be set to "no print" in the Layer Properties Manager right?

 

Why do insist on drawing on one layer, with an assigned color, only to override the layer's color? You do realize this is not a recommended practice right?

Edited by ReMark
Link to comment
Share on other sites

I drew one line (see yellow arrow) and mirrored based on its midpoint.

 

MirrorThis.JPG

 

Lisp doesn't necessarily have to be the answer to all of our problems. Maybe we're just getting lazy?

Link to comment
Share on other sites

Dear Masters,

 

thank you for yours kind replies.in my original drawing contains many objects like points, lines, blocks, text etc.i have facing difficulty to draw line for mirroring. because all items are irregular intervals. i am confusing minimum and maximum coo ordinates to draw line (because minor differences between points to point, and points are very closer and overlaping). so if any possibility by lisp kindly share.

 

Thanking you all,

Best Regards.

Link to comment
Share on other sites

It sounds like you want a definitive solution to a problem with many variables.

 

Please attach a full drawing with at least six groups of objects that have to be mirrored so we can get some sense of what you are dealing with?

 

How do you plan on picking the objects?

 

Who or what determines the basepoint for the mirroring process?

Link to comment
Share on other sites

Dear sir,

Thank you for your kind reply,

 

selecting by cross window, and mirroring as mention procedure at Post#3 & #4 ( Mid point of selected objects with reference to y coordinates). full drawing is bit confusing. that's why i have posted simple drawing. Post #3 & #4 are exact procedure by manually draw line and applied mirror. i need lisp version for the same, to apply for large content drawing like a Quick mirror lisp.

 

Thanking you,

Best regards.

Link to comment
Share on other sites

I think it would be really helpful if you provided a full drawing so people can see what they are actually dealing with. The benefit to all is that you don't have to come back and say the program needs to be tweaked because it doesn't satisfy all conditions.

Link to comment
Share on other sites

If the co-ordinates of the project are not relevant then just grab all the objects and pick an approx center keep ortho on and mirror. Do the blue circles have some sort of relevance to the rest of the objects ? Like Remark it seems to me that were being asked for something so simple that does not need a lisp.

ScreenShot060.jpg

Link to comment
Share on other sites

You have changed the rules in your first post you make no mention of many drawings. How many ? 100? If its ten do manually. A quick and dirty lisp would be to turn off the blue circle layer then get extmax extmin and do a mirror, turn back on blue circles and save. Add a list of dwg names to a script and quickly done. Is this what you want ?

Link to comment
Share on other sites

I think what the OP wants BIGAL is a fully developed lisp routine to handle the task written by someone other than himself.

Dear sir,

Thank you for asking.

 

i need mirror procedure which is mentioned in post#4.i.e, manually drew a line and applying mirror about midpoint of the line.

 

i need same above task by lisp routine without draw line and choosing mid point manually for selected objects.

 

 

Thanking you,

Best regards.

Link to comment
Share on other sites

Just need some rules for us to do something and not have to keep changing the code.

 

What layers are to be turned off, not included in mirror.

What objects to be used for setting mirror line "max Y" "min Y" is it just the points ? See post #4

 

It can be automated via a script for as many dwg's as you want.

 

open dwg1 (load "mymirror") close Y
open dwg2 (load "mymirror") close Y
open dwg3 (load "mymirror") close Y

 

(setq ss (ssget "x" '((0 . "point")(410 . "model"))))
(setq ymin 1000000.0)
(setq ymax 0.0)
(repeat (setq x (sslength ss))
(setq pt (assoc 10 (entget (ssname ss (setq x (- x 1))))))
(if (< (caddr pt) ymin)
(setq ymin (caddr pt))
)
(if (> (caddr pt) ymax)
(setq ymax (caddr pt))
)
)

(alert (strcat "Ymax " (rtos ymax 2 3) "Ymin " (rtos ymin 2 3)))
; draw line and mirror ran out of time

Link to comment
Share on other sites

Just need some rules for us to do something and not have to keep changing the code.

 

What layers are to be turned off, not included in mirror.

What objects to be used for setting mirror line "max Y" "min Y" is it just the points ? See post #4

 

It can be automated via a script for as many dwg's as you want.

 

Dear sir,

Thank you for your kind help. please describe how to use your code and i have aware of Layers On/OFF. your code should be run by selected objects only.

 

yes your concept is correct. i.e Taking min and Max values of Y from selected objects and find out mid point then mirror is starts.

 

Thanking you,

Best regards.

Link to comment
Share on other sites

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...