Jump to content

Add an Item to flip parameter?


Lt Dan's legs

Recommended Posts

When you

(vlax-dump-object 
 (setq [u][b]v[/b][/u] (vlax-ename->vla-object (car (entsel)))
 ) t
)

 

a flip parameter you get

; IAcadBlockFlipActionEntity: IAcadBlockFlipActionEntity Interface
; Property values:
;   ActionType (RO) = "Flip"
; etc.
;   ObjectName (RO) = "AcDbBlockFlipActionEntity"
; etc.
; Methods supported:
;   ArrayPolar (3)
;   ArrayRectangular (6)
;   Copy ()
;   Delete ()
;   GetBoundingBox (2)
;   GetExtensionDictionary ()
;   GetXData (3)
;   Highlight (1)
;   IntersectWith (2)
;   Mirror (2)
;   Mirror3D (3)
;   Move (2)
;   Rotate (2)
;   Rotate3D (3)
;   ScaleEntity (2)
;   SelectionSet ()
;   SetSelectionSet (1)
;   SetXData (2)
;   TransformBy (1)
;   Update ()

 

but if you try to use

(vla-Selectionset v)

or

(vlax-invoke v 'SelectionSet)

you'll get

; error: no function definition: VLA-SELECTIONSET

 

How do I go about adding an object to the flip parameter without using command calls?

Link to comment
Share on other sites

I figured it out.

 

NOTE: Use editing a dynamic block (in block editor).

 

(defun c:test ( / ss->lst action ss )
 (vl-load-com)
 (defun ss->lst ( ss flag / id lst )
   (if (eq 'PICKSET (type ss))
     (repeat (setq id (sslength ss))
       (
         (lambda ( name )
           (setq lst
             (cons
               (if flag (vlax-ename->vla-object name)
                 name
               )lst
             )
           )
         )(ssname ss (setq id (1- id)))
       )
     )
   )
 )
 (if 
   (and (or (eq 1 (getvar 'blockeditor))(prompt "\n**Must be in block editor to use!**"))
     (setq action (car (entsel "\nSelect an Action Entity: ")))
     (setq action (vlax-ename->vla-object action))
     (setq ss (ss->lst (ssget) t))
   )
   (
     (lambda ( group )
       (vlax-invoke-method action 'SetSelectionSet
         (vlax-make-variant
           (vlax-safearray-fill
             (vlax-make-safearray vlax-vbobject
               (cons 0 (1- (length group)))
             ) group
           )
         )
       )
     )
     (append
       (vlax-safearray->list
         (vlax-variant-value
           (vlax-invoke-method action 'SelectionSet)
         )
       ) ss
     )
   )
 ) (princ)
)

Edited by Lt Dan's legs
forgot vl-load-com
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...