Visual LISP, AutoLISP and General Customization

Reply
Mentor
devitg
Posts: 1,692
Registered: ‎03-14-2004
Message 11 of 23 (176 Views)

Re: Select Arcs by with Normal Z = -1

02-12-2013 06:35 AM in reply to: devitg

at least , not ay least

*Expert Elite*
Kent1Cooper
Posts: 5,242
Registered: ‎09-13-2004
Message 12 of 23 (174 Views)

Re: Select Arcs by with Normal Z = -1

02-12-2013 06:37 AM in reply to: Kent1Cooper

Kent1Cooper wrote:
.....  I gave a quick try to Mirror3D, but I must have been misunderstanding how to define the axis, because it didn't work.  ....

EDIT:  NO, hold off on that [I hadn't done something I should have....].  I was trying the Object option, which works manually, but doesn't accept an entity name in a (command) function.

Kent Cooper
*Expert Elite*
hmsilva
Posts: 2,644
Registered: ‎12-17-2004
Message 13 of 23 (162 Views)

Re: Select Arcs by with Normal Z = -1

02-12-2013 07:10 AM in reply to: bhaushalter1

normal z=-1

 

command: flatten

 

nornal z = 1

 

 

Henrique

Mentor
devitg
Posts: 1,692
Registered: ‎03-14-2004
Message 14 of 23 (161 Views)

Re: Select Arcs by with Normal Z = -1

02-12-2013 07:13 AM in reply to: hmsilva

Just SIMPLE , thanks

 

Active Member
bhaushalter1
Posts: 8
Registered: ‎02-11-2013
Message 15 of 23 (157 Views)

Re: Select Arcs by with Normal Z = -1

02-12-2013 07:18 AM in reply to: devitg

Thanks again Guys for your invaluable help. I ended up finding a program and applying devitg's filter suggestion and it works great!!!!

 

(defun c:fliparcs3 (/ ss hpi en el)
  (setq
    ss (ssget "X" (list (cons 0 "ARC") (cons 210 '( 0 0 -1))))
    hpi (* 0.5 pi)
  )
  (cond
    (
      (not (null ss))
      (repeat (sslength ss)
        (ssdel (setq en (ssname ss 0)) ss)
        (setq el (entget en))
        (entmod
          (mapcar
            (function
              (lambda (x / g)
                (setq g (car x))
                (cond
                  ((= g 10) (cons 10 (mapcar '* (list -1.0 1.0 -1.0) (cdr x))))
                  ((= g 210) (cons 210 (mapcar '- (cdr x))))
                  ((= g 50) (cons 50 (+ hpi (- hpi (cdr (assoc 51 el))))))
                  ((= g 51) (cons 51 (+ hpi (- hpi (cdr (assoc 50 el))))))
                  (t x)
                )
              )
            )
            el
          )
        )
      )
      (princ "\nDone")
    )
    (t (princ "\nNothing selected"))
  )
  (princ)
)

*Expert Elite*
hmsilva
Posts: 2,644
Registered: ‎12-17-2004
Message 16 of 23 (155 Views)

Re: Select Arcs by with Normal Z = -1

02-12-2013 07:22 AM in reply to: devitg

You're welcome, devitg

Active Member
bhaushalter1
Posts: 8
Registered: ‎02-11-2013
Message 17 of 23 (148 Views)

Re: Select Arcs by with Normal Z = -1

02-12-2013 07:38 AM in reply to: hmsilva

hmsilva wrote:

normal z=-1

 

command: flatten

 

nornal z = 1

 

 

Henrique


I tried that originally but for some reason these DXF files will not convert to a joined polyline after using that command. If I flip the arcs with the normal z of -1 they will.

*Expert Elite*
hmsilva
Posts: 2,644
Registered: ‎12-17-2004
Message 18 of 23 (146 Views)

Re: Select Arcs by with Normal Z = -1

02-12-2013 07:46 AM in reply to: bhaushalter1

bhaushalter1,

just flatten and pedit...

 

Henrique

Active Member
bhaushalter1
Posts: 8
Registered: ‎02-11-2013
Message 19 of 23 (136 Views)

Re: Select Arcs by with Normal Z = -1

02-12-2013 08:56 AM in reply to: hmsilva

hmsilva wrote:

bhaushalter1,

just flatten and pedit...

 

Henrique


Interesting... I must be doing something wrong. Im new to ACad.  Below are my steps:

 

Command: ucs
Current ucs name:  *WORLD*
Specify origin of UCS or [Face/NAmed/OBject/Previous/View/World/X/Y/Z/ZAxis]
<World>: w
Command: plan
Enter an option [Current ucs/Ucs/World] <Current>:
Regenerating model.
Command: flatten
Select objects to convert to 2d...
Select objects: Specify opposite corner: 19 found
Select objects:
Remove hidden lines? <Yes>:
-
Command: pedit
Select polyline or [Multiple]:
Object selected is not a polyline
Do you want to turn it into one? <Y>
Enter an option [Close/Join/Width/Edit vertex/Fit/Spline/Decurve/Ltype
gen/Reverse/Undo]: j
Select objects: 1 found
Select objects: 1 found, 2 total
Select objects: 1 found, 3 total
Select objects: 1 found, 4 total
Select objects: 1 found, 5 total
Select objects:
0 segments added to polyline

*Expert Elite*
hmsilva
Posts: 2,644
Registered: ‎12-17-2004
Message 20 of 23 (130 Views)

Re: Select Arcs by with Normal Z = -1

02-12-2013 09:23 AM in reply to: bhaushalter1

bhaushalter1,

in this example, in the pedit command, I used the option multiple to be faster, and in this way created two polylines

 

Command: ucs
Current ucs name:  *WORLD*
Specify origin of UCS or [Face/NAmed/OBject/Previous/View/World/X/Y/Z/ZAxis]
<World>: w
Command: plan
Enter an option [Current ucs/Ucs/World] <Current>:
Regenerating model.
Command: flatten
Select objects to convert to 2d...
Select objects: all
19 found
Select objects:
Remove hidden lines? <No>:
Command: pe
PEDIT Select polyline or [Multiple]: Select polyline or [Multiple]: m
Select objects: all
19 found
Select objects:
Convert Lines, Arcs and Splines to polylines [Yes/No]? <Y>
Enter an option [Close/Open/Join/Width/Fit/Spline/Decurve/Ltype
gen/Reverse/Undo]: j
Join Type = Extend
Enter fuzz distance or [Jointype] <0.0000>:
17 segments added to 2 polylines

 

but if you select the objects in the orden which we want the polyline be joined, like the dwg I have attached you'll only get with one polyline

 

Command: pedit Select polyline or [Multiple]:
Object selected is not a polyline
Do you want to turn it into one? <Y>
Enter an option [Close/Join/Width/Edit vertex/Fit/Spline/Decurve/Ltype
gen/Reverse/Undo]: j
Select objects: 1 found
Select objects: 1 found, 2 total
Select objects: 1 found, 3 total
Select objects: Specify opposite corner: 13 found, 16 total
Select objects: 1 found, 17 total
Select objects: 1 found, 18 total
Select objects:
18 segments added to polyline

 

hope that helps

Henrique

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community