measure multiple

Discussion in 'AutoCAD' started by cadd_monkey, Feb 10, 2005.

  1. cadd_monkey

    cadd_monkey Guest

    anyone have a lisp routine to do this? or willing to help a fellow cad guy out?

    i'm tossing objects on a HUGE amount of lines and doing the measure command over and over again is driving me insane. the divide command will not work in this case.

    any ideas or help maybe???

    thanks
     
    cadd_monkey, Feb 10, 2005
    #1
  2. cadd_monkey

    T.Willey Guest

    If the information for the measure command is the same, and you can hard code it, I would make a selection set of all the objects, then issue the command to each object in the selection set.

    (setq ss (ssget))
    (setq cnt1 0)
    (while (setq Ent (ssname ss cnt1))
    (command "measure" Ent <whatever>)
    (setq cnt1 (1+ cnt1))
    )

    Hope that helps.
    Tim
     
    T.Willey, Feb 10, 2005
    #2
  3. cadd_monkey

    James Allen Guest

    I'm not really sure what you're asking, but here's a guess.

    menu macro?
    *^c^cmeasure \ b myblock y 24;
    lisp?
    (command "measure" pause "b" "myblock" "y" 24)

    Both untested.
    --
    James Allen, EIT
    Malicoat-Winslow Engineers, P.C.
    Columbia, MO


    command over and over again is driving me insane. the divide command will
    not work in this case.
     
    James Allen, Feb 10, 2005
    #3
  4. cadd_monkey

    cadd_monkey Guest

    thank you both, i'm just confussed on where i would put that. i'm lisp savy on where to load it and put it and minor tweaks but thats it.

    twilley i can't get my selection set to work. my wifes pc at home has some of her office cad things on it and i just type (ssx) and get selection set but no dice on mine here at the office i think thats what your trying to help me set up but not sure?

    james, not sure where to put those either to get them to work. i noticed your in columbia, crazy small world i was born in moberly...lol not there now but crazy to see your in my old stomping grounds.

    thanks for you help guys.

    JC
     
    cadd_monkey, Feb 10, 2005
    #4
  5. cadd_monkey

    T.Willey Guest

    What are you doing with the measure command? Are you useing it to put in points or blocks? Is the block the same always?

    These things could be entered by the user once, and then used throughout the whole little command you define. If you provide a little more info, then maybe we can help you get what you want.

    Tim
     
    T.Willey, Feb 10, 2005
    #5
  6. cadd_monkey

    cadd_monkey Guest

    i'm using it to put in blocks (plants). if i had it do multiple i would have it do multiple for only 1 block at a time (the plant bed for that specific plant)

    once the area for the bed has it's shape i offset lines on which the plants go along. then i measure the plant block along each line. would be nice to select all the lines for that bed then tell it which block then all done. rather than running though the command 5-10 times for each line.

    that make better sense? sorry about the vagueness
     
    cadd_monkey, Feb 10, 2005
    #6
  7. cadd_monkey

    T.Willey Guest

    Here is one that was done quickly, but worked on my test. See if this is what you wanted.

    Tim

    (defun c:MultiMeasure (/ ss BlkName opt1 Dist cnt1)

    (if (setq ss (ssget))
    (progn
    (while
    (and
    (setq BlkName (getstring "\n Enter name of block to insert: "))
    (not (tblsearch "block" BlkName))
    )
    )
    (initget "Y N")
    (setq opt1 (getstring "\n Align block with object? [Yes/No] <Y>: "))
    (if (not opt1)
    (setq opt1 "Y")
    )
    (setq Dist (getdist "\n Specify length of segment: "))
    (setq cnt1 0)
    (if (and opt1 Dist BlkName)
    (while (setq Ent (ssname ss cnt1))
    (command "_.measure" Ent "_b" BlkName opt1 Dist)
    (setq cnt1 (1+ cnt1))
    )
    )
    )
    )
    (princ)
    )
     
    T.Willey, Feb 10, 2005
    #7
  8. cadd_monkey

    cadd_monkey Guest

    T.Willey


    YOU DA MAN!!!!!!!

    thats exactly what i needed thank you very much!!!!! you've made my day
     
    cadd_monkey, Feb 10, 2005
    #8
  9. cadd_monkey

    T.Willey Guest

    hahahahhah....

    Glad that is what you wanted. It only works for using blocks, so if want it to do other things then you will have to rework it. One more thing, it won't let you enter a block name that isn't in the drawing, but if you can't remember the name you can escape out of it.

    Tim

    ps. Thanks for making me smile. =D
     
    T.Willey, Feb 10, 2005
    #9
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.