AbdRF Posted May 20, 2020 Posted May 20, 2020 Hello all, I need some help with extracting the block properties using vlax function. After doing some research I found this, for eg: to extract the block insertion point - (vlax-get (vlax-ename->vla-object (car (entsel "\nSelect object: "))) 'InsertionPoint) But if I tried to extract the block scale value using the same logic like this ,it is giving error (vlax-get (vlax-ename->vla-object (car (entsel "\nSelect object: "))) 'Scale) Here is the error which I got Select object: ; error: ActiveX Server returned the error: unknown name: "SCALE" So can somebody help me out in extracting the block scale value using the vlax function? Also, what is the difference between "vlax-get" and "vlax-get-property" ? Thanks Quote
rlx Posted May 20, 2020 Posted May 20, 2020 (edited) try 'xscalefactor , 'yscalefactor and 'zscalefactor https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlax-get-vs-vla-get/td-p/824046 https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlax-put-get-vs-vlax-put-get-property-not-the-same-as-help/td-p/2546526 Edited May 20, 2020 by rlx Quote
BIGAL Posted May 20, 2020 Posted May 20, 2020 If using VL recommend using dumpit.lsp so can see properties there are though different methods available to get the same answer as posted by rlx : DUMPIT Select entity: ; IAcadBlockReference 36ce68e0 : TeighaX Interface of an instance of a block definition inserted into a drawing ; ; Property values : ; ; Application (RO) = #<VLA-OBJECT IAcadApplication 00000000296C9D30> ; color = 256 ; Database (RO) = #<VLA-OBJECT IAcadDatabase 000000005DD1AED8> ; Document (RO) = #<VLA-OBJECT IAcadDocument 0000000029A630E8> ; EffectiveName (RO) = "aaa" ; EntityName (RO) = "AcDbBlockReference" ; EntityType (RO) = NIL ; Handle (RO) = "A4" ; HasAttributes (RO) = 0 ; HasExtensionDictionary (RO) = 0 ; Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 0000000036892228> ; InsertionPoint = (274.0 216.0 0.0) ; InsUnits (RO) = "Meters" ; InsUnitsFactor (RO) = 1.0 ; IsDynamicBlock (RO) = 0 ; Layer = "0" ; Linetype = "ByLayer" ; LinetypeScale = 1.0 ; Lineweight = -1 ; Material = "ByLayer" ; Name = "aaa" ; Normal = (0.0 0.0 1.0) ; ObjectID (RO) = 1573934064 ; ObjectID32 (RO) = 1573934064 ; ObjectName (RO) = "AcDbBlockReference" ; OwnerID (RO) = 917802848 ; OwnerID32 (RO) = 917802848 ; PlotStyleName = "ByLayer" ; Rotation = 0.0 ; TrueColor = #<VLA-OBJECT IAcadAcCmColor 000000005DD1B1F8> ; Visible = -1 ; XEffectiveScaleFactor = 1.0 ; XScaleFactor = 1.0 ; YEffectiveScaleFactor = 1.0 ; YScaleFactor = 1.0 ; ZEffectiveScaleFactor = 1.0 ; ZScaleFactor = 1.0 ; Quote
AbdRF Posted May 22, 2020 Author Posted May 22, 2020 On 5/20/2020 at 12:31 PM, rlx said: try 'xscalefactor , 'yscalefactor and 'zscalefactor https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlax-get-vs-vla-get/td-p/824046 https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlax-put-get-vs-vlax-put-get-property-not-the-same-as-help/td-p/2546526 Thanks @rlx. With this, I am able to extract the scale value. Quote
AbdRF Posted May 22, 2020 Author Posted May 22, 2020 On 5/21/2020 at 5:29 AM, BIGAL said: If using VL recommend using dumpit.lsp so can see properties there are though different methods available to get the same answer as posted by rlx : DUMPIT Select entity: ; IAcadBlockReference 36ce68e0 : TeighaX Interface of an instance of a block definition inserted into a drawing ; ; Property values : ; ; Application (RO) = #<VLA-OBJECT IAcadApplication 00000000296C9D30> ; color = 256 ; Database (RO) = #<VLA-OBJECT IAcadDatabase 000000005DD1AED8> ; Document (RO) = #<VLA-OBJECT IAcadDocument 0000000029A630E8> ; EffectiveName (RO) = "aaa" ; EntityName (RO) = "AcDbBlockReference" ; EntityType (RO) = NIL ; Handle (RO) = "A4" ; HasAttributes (RO) = 0 ; HasExtensionDictionary (RO) = 0 ; Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 0000000036892228> ; InsertionPoint = (274.0 216.0 0.0) ; InsUnits (RO) = "Meters" ; InsUnitsFactor (RO) = 1.0 ; IsDynamicBlock (RO) = 0 ; Layer = "0" ; Linetype = "ByLayer" ; LinetypeScale = 1.0 ; Lineweight = -1 ; Material = "ByLayer" ; Name = "aaa" ; Normal = (0.0 0.0 1.0) ; ObjectID (RO) = 1573934064 ; ObjectID32 (RO) = 1573934064 ; ObjectName (RO) = "AcDbBlockReference" ; OwnerID (RO) = 917802848 ; OwnerID32 (RO) = 917802848 ; PlotStyleName = "ByLayer" ; Rotation = 0.0 ; TrueColor = #<VLA-OBJECT IAcadAcCmColor 000000005DD1B1F8> ; Visible = -1 ; XEffectiveScaleFactor = 1.0 ; XScaleFactor = 1.0 ; YEffectiveScaleFactor = 1.0 ; YScaleFactor = 1.0 ; ZEffectiveScaleFactor = 1.0 ; ZScaleFactor = 1.0 ; Thanks @BIGAL Quote
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.