Jump to content

How do I select 'Angle to Fill' for Polar Array?


c2designkitchen

Recommended Posts

Hello everyone!

This is my first post! I just signed up after scouring Google for days on this problem:

The problem is that I can't select the proper angle for the 'Angle to Fill' parameter of the Polar Array.

  • I have tried clicking on every imaginable object to get the correct angle, but to no avail.

  • Another problem is that I can't just type in the angle I need because they aren't whole numbers.

  • I have the precision turned all the way up (0.00000000º), and I haven't found a way to measure the angles.

Can someone please help explain how to specify the precise 'Angle to Fill' from the already-drawn angles?

 

Basically my drawing is going use a set of 90 angles ranging from 90º to 30º, each angle will specify a polar array of 91 evenly-spaced rays.

Link to comment
Share on other sites

  • Replies 38
  • Created
  • Last Reply

Top Posters In This Topic

  • c2designkitchen

    14

  • SEANT

    10

  • Cam83

    5

  • wizman

    4

Top Posters In This Topic

Posted Images

For the "angle to fill", that is the total span of the objects, so I believe you want to enter "90" or "91" for number of objects then "30" (for example) as the angle to fill. AutoCAD would calculate each object is spaced 30/90.

Link to comment
Share on other sites

Thanks for your quick response, CarlB.

 

I actually have 90 Polar Arrays to make, and the 'Angle to Fill' could be anything from 90º to 30º. For instance, the first Array is elementary, since it is 90º and there are 91 rays. It gets trickier on the next angle though, because it is 89.33333333º, although I do not know what the other angles will be.

 

(Even though for this example, one could extrapolate a simple pattern of a -.6...º change for each new 'Angle to Fill', I have changed the range of angles in my drawing and so I need to find a better strategy.)

 

I believe the solution to this problem would be either a better understanding of the 'Pick Angle to Fill' button/prompt (and tool), which seems to be totally haywire - Or a way to measure the precise angle (0.00000000º) before starting the Array.

 

I tried to install this angle measurement routine: http://discussion.autodesk.com/forums/servlet/JiveServlet/download/247-649740-5872230-177931/AG_ADV.zip ), which I found at this site: http://discussion.autodesk.com/forums/message.jspa?messageID=5878369 ), but I was not able to get it working. The file contains a LISP, a DCL and an SLD, but I can't figure out how to get them to work.

Link to comment
Share on other sites

I’m not sure if this is what you are investigating, but: This command macro acquires an angle similar to the Rotate by Reference for the Polar array command. The user interface is command line only – no dialog box.

 

See demo.

 

^C^C_Select;\-array;p;;P;\\'Cal;ang(@,cur,cur);

PolarArray.gif

Link to comment
Share on other sites

Thank you, Sean!

 

This appears to be exactly what I am looking for!

 

Unfortunately, I do not understand how to make it work. I tried pasting that code in the command line and nothing happened. Could you please explain how to use the macro?

 

P.S., That animation is awesome!

Link to comment
Share on other sites

While it would be possible to automate this with Lisp or any of the other programming languages, the process was basic enough to just set up a command macro in a toolbar button. This is set up with the CUI command. See attached.

CUI.jpg

Link to comment
Share on other sites

Fantabulous!

 

I finally got it working, I just had to create a new toolbar to get it to happen.

 

Thanks for all your help man, those pictures must be worth at least 20,000 words!

Link to comment
Share on other sites

Hey, thanks again!

 

If you have time, could you take a look at this new topic that I started? I've been reading a little on macros, but still can't do much with them. I'm not sure if anyone with the right skills is on the case yet.

Link to comment
Share on other sites

Actually, people with lots of skills have demonstrated an interest.

 

 

It is a bit difficult to determine the ultimate goal based on the image or drawing. I do have to agree with the others, though, that said this looks like a procedural issue. Perhaps a different combination, or order, of command would eliminate the need to reconnect lines.

Link to comment
Share on other sites

Perhaps I have scared them off with my tone-deaf writing style? I am working on being less of a robot and more conversational in type.

 

I don't think there is an easy way to get the arrays to line up. When the rays are spot-on, they deviate from the circular arc of the Polar Array. The angles of the lines themselves are at extremely precise tolerances, so there is no different place to locate the center points. Also, I assume that the Object Snap tool is the only accurate way to make sure that the end points coincide. In the drawing, you will see that the outer rays do connect perfectly, but the overlap is greatest at the vertical line.

 

That sample DWG is hopefully enough to write a script, I just need something that can connect the endpoints from the lower array to those of the upper. It is going to take 20-40 hours to move each line by hand, even if I could do 2 at a time that would be a huge improvement. Like, maybe I could use a crossing window to pick 2 endpoints and use a macro to combine them?

 

Maybe after the drawing is completely done and the site is launched, I can hire a geometry/calculus genius to adjust the original angles so everything is perfect.

Link to comment
Share on other sites

I think you have dumbfounded many, with exacting requests but we don't know what you're trying to achieve and it just doesn't seem right.

 

The outer cyan lines are radial but have a different radius point than the inner white lines. So to get them to line up they would need to be moved, as well as rotated. If you don't do both they will not all be aligned. So why not delete the outer cyan lines, and extend the inner white ones?

Link to comment
Share on other sites

My thought process can be all over the place, but I was just trying to be specific.

 

The different radius points are integral to the design, they create the original angles for the arrays. There are actually 90 different radius points, one for each tier of arrays.

 

The most important thing in the drawing is the graduation of angles in each array. For each set of connected rays, the angle of the overall line changes slightly at each tier, making a curve of jointed straight lines.

 

The rays don't have to line up as far as their angle, they just have to connect to the endpoints of their closest neighbors above and below.

Link to comment
Share on other sites

I think you will be quite pleased with the AutoLisp routine posted by wizman in the sister thread - though you may have to include a line:

 

(vl-load-com)

 

Call to get the routine to run.

 

 

. . . . When the rays are spot-on, they deviate from the circular arc of the Polar Array. The angles of the lines themselves are at extremely precise tolerances, so there is no different place to locate the center points. Also, I . . . .

 

Some of the ramifications to that routine will be that there is no longer a consistent angle between the cyan lines. Also, the lengths of the cyan lines will vary.

Link to comment
Share on other sites

Aw, man. I was getting really excited about that routine, I was even going to bed early so I could get started on it sooner!

 

Unfortunately, the lines (or segments) have to stay at 111.11111111mm or the whole effect will be lost. The angles of the rays are also crucial.

 

That dude is seriously a whiz for whipping that up though! His instructions for running the script were so elegant as well, I must have spent six or eight hours in a warren of Google and tutorials on loading Lisps, never learning anything, and he explained it in like 1 sentence!

 

That is really sharp that you caught that line Sean, good eye! I was going to wait to try the macro til some other people had the chance to see it, since it's like an unfamilar script thing.

Link to comment
Share on other sites

Here is to move the bottom tiers:

 

 

(defun c:connect (/ end fuzz pt ron ss sset)
   (vl-load-com)
   (if (and (setq ss (ssget '((0 . "LINE"))))
            (setq fuzz 0.20)
       )
       (foreach x (setq sset (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))))

           (foreach p (list (vlax-curve-getstartpoint x)
                            (vlax-curve-getendpoint x)
                      )

               (foreach y sset
                   (if
                       (and (not (equal x y))

                            (not (equal (vlax-curve-getclosestpointto y p)
                                        p
                                        1e-8
                                 )
                            )

                            (or (<= (distance (setq pt (vlax-curve-getstartpoint y)) p)
                                    fuzz
                                )
                                (<= (distance (setq pt (vlax-curve-getendpoint y)) p)
                                    fuzz
                                )
                            )

                            (> (cadr p) (cadr pt))
                       )
                          (vla-move (vlax-ename->vla-object x)
                                    (vlax-3d-point
                                        (cdr (assoc (if (equal p (vlax-curve-getstartpoint x))
                                                        10
                                                        11
                                                    )
                                                    (entget x)
                                             )
                                        )
                                    )
                                    (vlax-3d-point pt)
                          )
                   )
               )
           )
       )
   )
)

Link to comment
Share on other sites

Excellent work, Wizman!

 

The Lisp works perfectly! Thank you so much!

 

Thanks again for all your help, everybody! This is going to be an awesome drawing!

Link to comment
Share on other sites

I’m not sure if this is what you are investigating, but: This command macro acquires an angle similar to the Rotate by Reference for the Polar array command. The user interface is command line only – no dialog box.

 

See demo.

 

^C^C_Select;\-array;p;;P;\\'Cal;ang(@,cur,cur);

 

Nice little macro Sean. Mind if I borrow it?

Link to comment
Share on other sites

Got busy at work today, Here's for adjusting gap and joining polylines:

 

 

(defun c:connect (/ flag fuzz plist pt ss sset )
   (vl-load-com)
   (defun *error* (msg)
       (and doc (vla-EndUndoMark doc))
       (acet-ui-progress)
       (setvar 'cmdecho 1)
   )

   (setq doc (vla-get-activedocument
                 (vlax-get-acad-object)
             )
   )
   (vla-EndUndoMark doc)
   (vla-StartUndoMark doc)
   (setvar 'cmdecho 0)
   (if (and (princ "Select Lines")
            (setq ss (ssget '((0 . "LINE"))))
            (setq fuzz (getreal "\nEnter Gap Tolerance: "))
            (not (initget "Yes No"))
            (setq flag (getkword "\nJoin into Polylines[Yes/No]: "))

       )
       (progn
           (setq sset (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))))
           (acet-ui-progress "PROCESSING..." (length sset))
           (foreach x sset
               (setq lst nil)
               (if (not (vlax-erased-p x))

                   (foreach p (setq plist (list (vlax-curve-getstartpoint x)
                                                (vlax-curve-getendpoint x)
                                          )
                              )

                       (foreach y sset

                           (and (not (equal x y))

                                (not (equal (vlax-curve-getclosestpointto y p)
                                            p
                                            1e-8
                                     )
                                )

                                (or (<= (distance (setq pt (vlax-curve-getstartpoint y)) p)
                                        fuzz
                                    )
                                    (<= (distance (setq pt (vlax-curve-getendpoint y)) p)
                                        fuzz
                                    )
                                )

                                (> (cadr p) (cadr pt))

                                (not (vla-move (vlax-ename->vla-object x)
                                               (vlax-3d-point p)
                                               (vlax-3d-point pt)
                                     )
                                )
                                (= flag "Yes")

                                (entmake
                                    (append
                                        (list (cons 0 "LWPOLYLINE")
                                              (cons 100 "AcDbEntity")
                                              (cons 100 "AcDbPolyline")
                                              (cons 90 3)
                                              (cons 70 0)
                                        )
                                        (vl-remove nil
                                                   (mapcar
                                                       (function
                                                           (lambda (p)
                                                               (if (not (vl-position p lst))
                                                                   (progn (setq lst (cons p lst))
                                                                          (cons 10 p)
                                                                   )
                                                               )
                                                           )
                                                       )

                                                       (vl-sort
                                                           (list
                                                               (vlax-curve-getstartpoint x)
                                                               (vlax-curve-getendpoint x)
                                                               (vlax-curve-getstartpoint y)
                                                               (vlax-curve-getendpoint y)
                                                           )
                                                           (function (lambda (e1 e2)
                                                                         (< (cadr e1) (cadr e2))
                                                                     )
                                                           )
                                                       )
                                                   )
                                        )
                                    )
                                )
                                (not (vla-delete (vlax-ename->vla-object x)))
                                (not (vla-delete (vlax-ename->vla-object y)))
                                (setq sset  (vl-remove x sset)
                                      sset  (vl-remove y sset)
                                      plist (vl-remove p plist)
                                )
                           )


                       )
                   )
               )
               (acet-ui-progress -1)
           )
           (error "")
       )
   )
   (princ)
)

Link to comment
Share on other sites

Woah, thanks man! Do you have a copy of my original message? I can re-edit my post to put that question back in...

 

Also, would it be possible to make the polyline combiner into a separate script? I already have about 20% of the drawing aligned at endpoints. I want to make the 90 polylines, but I don't want them to be combined at the very top. There are up to 90 short lines to be combined fro each polyline.

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