Jump to content

Recommended Posts

Posted

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

Posted

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
;

 

 

Posted
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 😀

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...