Jump to content

Recommended Posts

Posted
Me too - I've wanted to completely get my head around it first before just diving in, as the errors with Arx are a little more consequential than LISP :geek:

 

But its a great utility - so many possibilities.

 

The only thing that is annoying is that the user has to get the Arx, so its not a stand-along program. And also, the function doesn't react to direct keyboard input, but rather keyword and string input (at my current level of understanding of it), so you I haven't found a way to replicate my offset controls, for example, in the program in this thread.

 

But its a great function.

 

Lee

Yeah, I looked at it briefly on Thursday. I was hoping it had been written as a complete replacement for GrRead (just with OSnaps), and it kind-of is, for the most part, but it takes some getting used to. And as you said, ARX is not very forgiving on errors.

  • Replies 60
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    32

  • alanjt

    9

  • TimZilla

    4

  • Crank

    4

Top Posters In This Topic

Posted

I notice you went through a lot of trouble find the correct arx and load it (impressive, BTW). In that situation, I'd almost just leave it up to the user to have these things loaded and just check to make sure it's there. Short of downloading it for them, we have to put a little faith in the user.

Posted
I notice you went through a lot of trouble find the correct arx and load it (impressive, BTW). In that situation, I'd almost just leave it up to the user to have these things loaded and just check to make sure it's there.

 

Cheers mate, yeah I wanted to leave as little to the user as possible... you know what its like. Nobody reads instructions, then they complain that it doesn't work.

 

Short of downloading it for them, we have to put a little faith in the user.

 

Funny you should say that actually - I considered that option. I used that approach in my Point Manager program - I download the help file :)

Posted
Cheers mate, yeah I wanted to leave as little to the user as possible... you know what its like. Nobody reads instructions, then they complain that it doesn't work.

That's about the truth.:roll:

 

Funny you should say that actually - I considered that option. I used that approach in my Point Manager program - I download the help file :)

 

I saw that. I downloaded Point Manager (just to look at) after you suggested its use when I wrote the routine that would insert circles at each LWPolyline vertex for Gilsoto. I was throughly impressed with it. :) I played around with the VBScript to download a file about a year ago (someone at theSwamp had posted some example code), but never had a real use for it.

Posted

Is there away you can make the cirlce a block or just have an option to insert a block? Or maybe do an autonumber and loop the command on your block align lisp

 

 

sorry I was going to post this on

Incremental Numbering Suite - Comments/Criticism Welcome

 

or just have this lisp loop but keep the same curve selection until you exit?

Posted

There was a whole lot of different things going on in your last post - what exactly are you talking about?

Posted

Sorry! I can be pretty confusing. I have a block Named "wallball2". A cirle with an attribute inside. The code I'd like modified is:

(defun c:WB (/ ip)
 (if (setq *count* (getint "\nStarting number: "))
 (progn
-[Do your thing here...]
);progn
);if
 (setvar 'attdia 0)
 (while (setq ip (getpoint "\nInsertion Point: "))
   (command
     "_.insert"
     "WALLBALL2" ; your block name
     ip
     "" "" ""
     (strcat (itoa *count*))
); end command
   (setq *count* (1+ *count*))
 ); end while
 (setvar 'attdia 1)
);

 

The only reason I cannot use your Program Incremental Numbering Suite is because it needs to be blocks. I did notice you have the curve option which I really like. I was wondering if there was a way to use the curve option with the code above. Maybe only selecting the curve once and it will continously loop the command and automatically selects the curve, offset of 4" from the line and rotation always set at zero.

Posted

Why not insert your block using the code I helped you with here, and then use the program in this thread if you wish to align it to a curve.

Posted

I know you said change the tag but please show me where to change it. 99% of the code is greek to me

(defun c:InsertBlock ( / block tag space point )
 (vl-load-com)
 ;; Lee Mac  ~  05.05.10

 (setq block "Wallball2") ;; Block Name or nil

 (setq tag nil)   ;; Tag Name or nil

 (setq space
   (if
     (or
       (eq AcModelSpace
         (vla-get-ActiveSpace
           (setq doc
             (vla-get-ActiveDocument
               (vlax-get-acad-object)
             )
           )
         )
       )
       (eq :vlax-true
         (vla-get-MSpace doc)
       )
     )
     (vla-get-ModelSpace doc)
     (vla-get-PaperSpace doc)
   )
 )        

 (if
   (and
     (setq block (GetBlock block))
     (setq *num*
       (1-
         (cond
           (
             (getint
               (strcat "\nSpecify Starting Number <"
                 (itoa
                   (setq *num*
                     (cond ( *num* ) ( 1 ))
                   )
                 )
                 "> : "
               )
             )
           )
           ( *num* )
         )
       )
     )
   )

   (while
     (setq *num* (1+ *num*)
           point (getpoint "\nSpecify Point for Insertion: "))

     (if (and (setq obj (InsertBlock space block point)) tag)
       (PutAttValue obj tag (itoa *num*))
     )
   )
 )

 (princ)
)

(defun PutAttValue ( object tag value )
 ;; Lee Mac  ~  05.05.10
 (mapcar
   (function
     (lambda ( attrib )
       (and
         (eq tag (vla-get-TagString attrib))
         (vla-put-TextString attrib value)
       )
     )
   )
   (vlax-invoke object 'GetAttributes)
 )
 value
)

(defun GetBlock ( block )
 ;; Lee Mac  ~  05.05.10
 (cond
   (
     (not
       (and
         (or block
           (setq block
             (getfiled "Select Block" "" "dwg" 16)
           )
         )
         (or
           (and
             (vl-position
               (vl-filename-extension block) '("" nil)
             )
             (or
               (tblsearch "BLOCK" block)
               (setq block
                 (findfile
                   (strcat block ".dwg")
                 )
               )
             )
           )
           (setq block (findfile block))
         )
       )
     )
    nil
   )
   ( block )
 )
)

(defun InsertBlock ( Block Name Point )
 (if
   (not
     (vl-catch-all-error-p
       (setq result
         (vl-catch-all-apply (function vla-insertblock)
           (list Block (vlax-3D-point point) Name 1. 1. 1. 0.)
         )
       )
     )
   )
   result
 )
)

 

tag is N

Posted

I've noted at the top where to change block and tag name.

Posted

I'm an idiot. Thanks!!

  • 3 months later...
Posted

Lee i have to say that your programs are excellent, i have been after something like these for sometime.

 

Thumbs up!

Posted

Thanks Taillika_fan, I'm really glad you like them - I enjoyed writing them :)

  • 7 months later...
  • 1 month later...
Posted

Hi Lee,

 

I just discovered your amazing script, and absolutely love it.

 

Is it possible to add one more feature to the script?

That is to be able to:

1. Select a block

2. Select a curve

3. Option to select single or multiple

4. Click to place block one time or multiple times by simply clicking on new position.

Posted

Hi Roland,

 

Glad you like the program :)

 

I believe your suggestions would be possible - I'll have to see if I can get around to it.

 

Lee

  • 1 year later...
Posted

Lee,

 

As always your lisp routines are a pleasure to use and helpful in more situations than one. Excellent stuff and thumb up!!!

Posted
As always your lisp routines are a pleasure to use and helpful in more situations than one. Excellent stuff and thumb up!!!

 

Many thanks Baber!

 

The code for this program has actually since been updated to Version 1.3 and the latest version may be downloaded from my site here; the updated version will allow you to align objects to curves nested within Blocks or XRefs (nested to any level), in addition to primary objects.

 

Cheers,

 

Lee

  • 1 month later...
Posted

Hi Lee,

 

I just want to say your lisp routines are amazing. i am new to this world of lisp routines and i have a question regarding your block alignmemnt routine.

 

Is it possible to select more than 1 block at a time to align with a curve?

 

thanks in advance :)

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