Hi guys,
Shortly my question would be is it possible to create an dynamic block parameter (point/linear/polar/rotation...).
Obviously theres no method to invoke that creates it (like one would do with line/polyline/circle/text/mtext...).
Heres a dump on a block definition:
_$ (vlax-dump-object BlockObj T)
; IAcadBlock: A block definition containing a name and a set of objects
; Property values:
; Application (RO) = #<VLA-OBJECT IAcadApplication 00007ff7d08a9110>
; BlockScaling = 0
; Comments = ""
; Count (RO) = 2
; Document (RO) = #<VLA-OBJECT IAcadDocument 000000d8ba2bbe78>
; Explodable = -1
; Handle (RO) = "3AE"
; HasExtensionDictionary (RO) = 0
; IsDynamicBlock (RO) = 0
; IsLayout (RO) = 0
; IsXRef (RO) = 0
; Layout (RO) = AutoCAD.Application: The property is not available in current state
; Name = "bada"
; ObjectID (RO) = 62
; ObjectName (RO) = "AcDbBlockTableRecord"
; Origin = (0.0 0.0 0.0)
; OwnerID (RO) = 63
; Path = AutoCAD.Application: Not applicable
; Units = 0
; XRefDatabase (RO) = AutoCAD.Application: No database
; Methods supported:
; Add3DFace (4)
; Add3DMesh (3)
; Add3DPoly (1)
; AddArc (4)
; AddAttribute (6)
; AddBox (4)
; AddCircle (2)
; AddCone (3)
; AddCustomObject (1)
; AddCylinder (3)
; AddDim3PointAngular (4)
; AddDimAligned (3)
; AddDimAngular (4)
; AddDimArc (4)
; AddDimDiametric (3)
; AddDimOrdinate (3)
; AddDimRadial (3)
; AddDimRadialLarge (5)
; AddDimRotated (4)
; AddEllipse (3)
; AddEllipticalCone (4)
; AddEllipticalCylinder (4)
; AddExtrudedSolid (3)
; AddExtrudedSolidAlongPath (2)
; AddHatch (4)
; AddLeader (3)
; AddLightWeightPolyline (1)
; AddLine (2)
; AddMInsertBlock (11)
; AddMLeader (2)
; AddMLine (1)
; AddMText (3)
; AddPoint (1)
; AddPolyfaceMesh (2)
; AddPolyline (1)
; AddRaster (4)
; AddRay (2)
; AddRegion (1)
; AddRevolvedSolid (4)
; AddSection (3)
; AddShape (4)
; AddSolid (4)
; AddSphere (2)
; AddSpline (3)
; AddTable (5)
; AddText (3)
; AddTolerance (3)
; AddTorus (3)
; AddTrace (1)
; AddWedge (4)
; AddXline (2)
; AttachExternalReference (9)
; Bind (1)
; Delete ()
; Detach ()
; GetExtensionDictionary ()
; GetXData (3)
; InsertBlock (7)
; Item (1)
; Reload ()
; SetXData (2)
; Unload ()
Heres a dump on a linear parameter that I want to create:
_$ (vlax-dump-object (vlax-ename->vla-object (car (entsel))) T)
; IAcadBlockLinearParameterEntity: IAcadBlockLinearParameterEntity Interface
; Property values:
; Angle (RO) = 0.0
; Application (RO) = #<VLA-OBJECT IAcadApplication 00007ff7d08a9110>
; BaseLocation = 0
; BasePoint = (0.0 0.0 0.0)
; ChainActions = 0
; Distance = 200.0
; DistanceDesc = ""
; DistName = "Distance1"
; Document (RO) = #<VLA-OBJECT IAcadDocument 000000d8ba2bbe78>
; EndPoint = (200.0 0.0 0.0)
; EntityTransparency = "ByLayer"
; Grips = 1
; Handle (RO) = "3A6"
; HasExtensionDictionary (RO) = 0
; Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 000000e0bfc8ba78>
; LabelDist = -15.5303
; Layer = "0"
; Linetype = "ByLayer"
; LinetypeScale = 1.0
; Lineweight = -1
; Material = "ByLayer"
; Name = "Linear"
; ObjectID (RO) = 59
; ObjectName (RO) = "AcDbBlockLinearParameterEntity"
; OwnerID (RO) = 60
; PlotStyleName = "ByLayer"
; ShowProperties = -1
; TrueColor = #<VLA-OBJECT IAcadAcCmColor 000000e0bfc8ad50>
; ValueSetIncrement = Exception occurred
; ValueSetList = Exception occurred
; ValueSetMax = 0.0
; ValueSetMin = 0.0
; ValueSetType = 0
; Visible = -1
; 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)
; SetXData (2)
; TransformBy (1)
; Update ()
I've wrote something to check atleast where these stuff are stored (and found their enames under "ACAD_EVALUATION_GRAPH" dictionary):
(defun test ( / e o nm enx next LstEnames LstObjs )
(if
(and
(setq e (car (entsel "\nSelect the block: ")))
(setq o (vlax-ename->vla-object e))
(eq (vla-get-ObjectName o) "AcDbBlockReference")
(eq (vla-get-IsDynamicBlock o) :vlax-true)
)
(progn
(setq nm (vla-get-EffectiveName o))
(setq enx (entget (tblobjname "BLOCK" nm)))
(setq next (tblobjname "BLOCK" nm))
(while (and (setq next (entnext next)) (/= "ENDBLK" (cdr (assoc 0 (entget next)))))
(setq LstEnames (cons next LstEnames))
)
(vlax-for x (setq BlkDefObj (vla-item (vla-get-Blocks (vla-get-ActiveDocument (vlax-get-acad-object))) nm))
(setq LstObjs (cons x LstObjs))
)
(print (mapcar '(lambda (x) (cdr (assoc 0 (entget x)))) LstEnames))
(print (mapcar '(lambda (x) (vla-get-ObjectName x)) LstObjs))
(vlax-for x (setq extDictObj (vlax-invoke BlkDefObj 'GetExtensionDictionary))
(setq LstExtObjs (cons x LstExtObjs))
)
(setq extDictEnx (entget (handent (vla-get-Handle extDictObj))))
(setq ACAD_EVALUATION_GRAPH (entget (cdr (cadr (member (cons 3 "ACAD_ENHANCEDBLOCK") extDictEnx)))))
(setq PrmsLst (vl-remove-if-not (function (lambda (x) (= 360 (car x)))) ACAD_EVALUATION_GRAPH))
(setq PrmsLst (mapcar 'entget (mapcar 'cdr PrmsLst)))
(foreach x (mapcar '(lambda (x) (cdr (assoc 0 x))) PrmsLst) (print x))
)
)
(princ)
)
Print Result:
_$ (test)
("ATTDEF" "ATTDEF" "ATTDEF" "INSERT" "INSERT" "INSERT" "INSERT" "LINE" "LINE" "LWPOLYLINE")
("AcDbAttributeDefinition" "AcDbAttributeDefinition" "AcDbAttributeDefinition" "AcDbBlockReference" "AcDbBlockReference" "AcDbBlockReference" "AcDbBlockReference" "AcDbLine" "AcDbLine" "AcDbPolyline")
"BLOCKLINEARPARAMETER"
"BLOCKLINEARGRIP"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKLINEARPARAMETER"
"BLOCKLINEARGRIP"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKLINEARPARAMETER"
"BLOCKLINEARGRIP"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKLINEARPARAMETER"
"BLOCKLINEARGRIP"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKGRIPLOCATIONCOMPONENT"
"BLOCKSTRETCHACTION"
"BLOCKSTRETCHACTION"
"BLOCKSTRETCHACTION"
"BLOCKSTRETCHACTION"
_$