handasa Posted September 8, 2017 Share Posted September 8, 2017 Greetings every one i have a block and i want to scale its subentities by using (setq acdoc (vla-get-ActiveDocument (vlax-get-acad-object)) blocks (vla-get-Blocks acdoc)) (setq itm (car (entsel))) (setq name (vla-get-Name (vlax-ename->vla-object itm))) (setq def (vla-item blocks name)) (setq base (vla-get-Origin def)) (vlax-for o def (vla-ScaleEntity o base 0.5)) the routine process only the selected block ... and the other instances of block won't be updated in the drawing unitl i open block editor "bedit" and do some staff there and save and close it any suggestions will be appreciated .. thanks Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 8, 2017 Share Posted September 8, 2017 Is your block dynamic by any chance? Quote Link to comment Share on other sites More sharing options...
handasa Posted September 8, 2017 Author Share Posted September 8, 2017 yes it is i use this now to do the jop (COMMAND "-BEDIT" "" blockname) (COMMAND "ZOOM" "A") (COMMAND "_BCLOSE" "SAVE") Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 9, 2017 Share Posted September 9, 2017 Just add this to last line of your original code (vla-Regen acdoc acActiveViewport) Quote Link to comment Share on other sites More sharing options...
handasa Posted September 9, 2017 Author Share Posted September 9, 2017 i use this (vla-Regen acdoc acAllViewports) also with no hope these are two blocks with the same scale they only get back to their correct scales after opening block editor and save block Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 9, 2017 Share Posted September 9, 2017 yes it isi use this now to do the jop If a dynamic block reference has dynamic block parameter values which differ from the block definition, then the dynamic block reference will reference an anonymous block definition which contains geometry matching the expected display for the set of dynamic parameter values. Therefore, if you wish to scale the objects within every dynamic block reference, you will need to scale the objects within the dynamic block definition, and every anonymous block definition pertaining to the dynamic block. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted September 9, 2017 Share Posted September 9, 2017 .... and you may lose the control / benefit of these parameters when scaling the related / connected objects unless that Parameter is other than visibility. Quote Link to comment Share on other sites More sharing options...
Grrr Posted September 9, 2017 Share Posted September 9, 2017 .... and you may lose the control / benefit of these parameters when scaling the related / connected objects unless that Parameter is other than visibility. I'm guessing cause there are no methods supported for the parameter object: _$ (vlax-dump-object (car (vlax-invoke (vlax-ename->vla-object (car (entsel "\nPick dynamic block: "))) 'GetDynamicBlockProperties)) t) ; IAcadDynamicBlockReferenceProperty: AutoCAD Dynamic Block Property Interface ; Property values: ; AllowedValues (RO) = nil ; Description (RO) = "" ; PropertyName (RO) = "blabla" ; ReadOnly (RO) = 0 ; show (RO) = -1 ; UnitsType (RO) = 2 ; Value = 60.0 [color="red"]; No methods[/color] Therefore ScaleEntity method is not available. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted September 9, 2017 Share Posted September 9, 2017 I'm guessing cause there are no methods supported for the parameter object: Therefore ScaleEntity method is not available. When objects being scaled bigger for instance then objects may get out of the parameter's selection limits, so this should escape objects from the boundary of any parameter other than Visibility since the last one doesn't require any selection. Hope this clear enough. Quote Link to comment Share on other sites More sharing options...
Grrr Posted September 9, 2017 Share Posted September 9, 2017 When objects being scaled bigger for instance then objects may get out of the parameter's selection limits, so this should escape objects from the boundary of any parameter other than Visibility since the last one doesn't require any selection. Hope this clear enough. Ahh, now I understood what you mean (by visualising how the parameter shall be created from scratch by hand). Quote Link to comment Share on other sites More sharing options...
guigonse Posted September 9, 2017 Share Posted September 9, 2017 We used to use the (entupd ename) in the old good AutoLisp times... It was mandatory when modifying complex entities, like old-style POLYLINES and (yes! :-) BLOCKS... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.