Results 1 to 3 of 3

Thread: Stretch Function with Grips

  1. #1
    Member
    Join Date
    2015-09
    Posts
    8
    Login to Give a bone
    0

    Default Stretch Function with Grips

    We have a set of dynamic blocks, each block has two points (grips); one input, one output. We use many of these blocks in our drawing packages and it becomes cumbersome to click on each block, then shift click on the grip we want to move.

    I am looking for a method that will be more similar to the stretch command where I draw a crossing window (or fence) and can move a group. I have done some research and, from what I can find, this may not be possible, but of course unless I hit the exact terms in Google things like this are always hard to find. Does anyone have experience with a situation like this, is it possible?

    Thanks

  2. #2
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    561
    Login to Give a bone
    0

    Default Re: Stretch Function with Grips

    If you have Properties open when you click on a dynamic block it shows the current value of the constraints you can type in a new value or is the new point random ?

    You can set a value also via lisp you could pick a point and use some form of reference point say from the insertion point to get the distance and update the block.

    If you have a look at www.lee-mac.com dynamic block functions the get & put is what you need.

    Need more info say an image or dwg.

    Code:
    ;; Get Dynamic Block Property Value  -  Lee Mac
    ;; Returns the value of a Dynamic Block property (if present)
    ;; blk - [vla] VLA Dynamic Block Reference object
    ;; prp - [str] Dynamic Block property name (case-insensitive)
    
    (defun LM:getdynpropvalue ( blk prp )
        (setq prp (strcase prp))
        (vl-some '(lambda ( x ) (if (= prp (strcase (vla-get-propertyname x))) (vlax-get x 'value)))
            (vlax-invoke blk 'getdynamicblockproperties)
        )
    )
    
    ;; Set Dynamic Block Property Value  -  Lee Mac
    ;; Modifies the value of a Dynamic Block property (if present)
    ;; blk - [vla] VLA Dynamic Block Reference object
    ;; prp - [str] Dynamic Block property name (case-insensitive)
    ;; val - [any] New value for property
    ;; Returns: [any] New value if successful, else nil
    
    (defun LM:setdynpropvalue ( blk prp val )
        (setq prp (strcase prp))
        (vl-some
           '(lambda ( x )
                (if (= prp (strcase (vla-get-propertyname x)))
                    (progn
                        (vla-put-value x (vlax-make-variant val (vlax-variant-type (vla-get-value x))))
                        (cond (val) (t))
                    )
                )
            )
            (vlax-invoke blk 'getdynamicblockproperties)
        )
    )
    
    ;sample code starts here
    (setq blk (vlax-ename->vla-object (car (entsel "Pick block"))))
    (LM:setdynpropvalue  blk "distance4" (getint "enter length") ) ; change distance4 for value
    Last edited by BIG-AL; 2017-09-17 at 01:20 AM.

  3. #3
    Member
    Join Date
    2015-09
    Posts
    8
    Login to Give a bone
    0

    Default Re: Stretch Function with Grips

    Thanks Al,

    Unfortunately the distances can be any length. I have attached the block, a few things going on there but essentially the left and right connectors can be moved separately in any X-Y direction. I am looking for a method to move a group of either the left or right connectors as a group more easily (like stretch or the regular move command).
    Attached Files Attached Files

Similar Threads

  1. stretch a line with grips
    By caduzer in forum AutoCAD General
    Replies: 6
    Last Post: 2009-11-16, 04:18 PM
  2. Lines with grips that stretch
    By linds in forum Revit Architecture - General
    Replies: 5
    Last Post: 2009-07-08, 03:37 PM
  3. Stretch with grips problem
    By radunic in forum ACA General
    Replies: 3
    Last Post: 2009-05-18, 05:18 PM
  4. Stretch Using Grips
    By rustific41657 in forum AutoCAD General
    Replies: 8
    Last Post: 2006-08-17, 04:26 AM
  5. Viewport will not stretch using grips.
    By GreyHippo in forum AutoCAD General
    Replies: 16
    Last Post: 2006-07-15, 11:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •