How to get the same properties than "List" Command with a visual lisp

How to get the same properties than "List" Command with a visual lisp

juanraXSVE3
Participant Participant
609 Views
10 Replies
Message 1 of 11

How to get the same properties than "List" Command with a visual lisp

juanraXSVE3
Participant
Participant

Hi colleagues.

I have a prostructure objects on my file. I need to get some geometrical and data info from these objects.

When i use "List" Command I get this info:

KS_SHAPE  Capa: "PS_Shape"
                         Espacio: Espacio modelo
                  Identificador = 7876
Coordinates of Object Entity Coordinate System
Origin   X=-4518.9589 Y=110650.0000 Z= 6641.6238
Xaxis    X=    1.0000 Y=    0.0000 Z=    0.0000
Yaxis    X=    0.0000 Y=   -1.0000 Z=    0.0000
Number of Logical Links 1
Link 0   Target->7875  Type=1
Index =0  Connections=0 Bolts=0
VersionIndex = 0
Modification: 30.09.2021 09:02 |  | Modification
Name of Part            =IPE 100
PartOrigin              =-1
Number of CutPlanes     =2
CutPlane No. 1
Point on CutPlane
         X=-4518.9589 Y=110650.0000 Z= 6641.6238 Flag=0
NormalVector of Cutplane
         X=    0.0000 Y=    0.0000 Z=    1.0000
CutPlane No. 2
Point on CutPlane
         X=-4518.9589 Y=110650.0000 Z= 6261.9500 Flag=0
NormalVector of Cutplane
         X=    0.0000 Y=    0.0000 Z=   -1.0000

Pulse INTRO para continuar:
Katalog      = DIN.DIN_IPE
Key          = IPE100
Name         = IPE 100
DimSystem   = Metric
GravityX     =   27.5000 GravityY =   50.0000
Med  Res PolyCount=1
Med   Nr=0 X=-27.500000 Y=-50.000000 Bulge=0.000000
Med   Nr=1 X=27.500000 Y=-50.000000 Bulge=0.000000
Med   Nr=2 X=27.500000 Y=-44.300000 Bulge=0.000000
Med   Nr=3 X=9.050000 Y=-44.300000 Bulge=-0.414214
Med   Nr=4 X=2.050000 Y=-37.300000 Bulge=0.000000
Med   Nr=5 X=2.050000 Y=37.300000 Bulge=-0.414214
Med   Nr=6 X=9.050000 Y=44.300000 Bulge=0.000000
Med   Nr=7 X=27.500000 Y=44.300000 Bulge=0.000000
Med   Nr=8 X=27.500000 Y=50.000000 Bulge=0.000000
Med   Nr=9 X=-27.500000 Y=50.000000 Bulge=0.000000
Med   Nr=10 X=-27.500000 Y=44.300000 Bulge=0.000000
Med   Nr=11 X=-9.050000 Y=44.300000 Bulge=-0.414214
Med   Nr=12 X=-2.050000 Y=37.300000 Bulge=0.000000
Med   Nr=13 X=-2.050000 Y=-37.300000 Bulge=-0.414214
Med   Nr=14 X=-9.050000 Y=-44.300000 Bulge=0.000000
Med   Nr=15 X=-27.500000 Y=-44.300000 Bulge=0.000000
Pulse INTRO para continuar:
Med   Nr=16 X=-27.500000 Y=-50.000000 Bulge=0.000000
Shapelen     =  379.6738
MidLine from =-4518.9589,110650.0000, 6641.6238
          to =-4518.9589,110650.0000, 6261.9500
InsertX      =    0.0000 InsertY=    0.0000

All of these data are important for my code. I need to find these info and use to crop the object and draw some especial elements from this info.

 

I tried to get the info with entget(it's not enought)

((-1 . <Nombre entidad: 271b8e24660>) (0 . "KS_SHAPE") (5 . "7876") (102 . "{ACAD_XDICTIONARY") (360 . <Nombre entidad: 271ba8d6b50>) (102 . "}") (330 . <Nombre entidad: 271b8e0f6c0>) (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "PS_Shape"))

 

Also I tried to get with vlax-get-property, but the vlax-dump-object command throw these data:

; IAcadEntity: Interfaz de entidades de AutoCAD
; Valores de propiedad:
;   Application (RO) = #<VLA-OBJECT IAcadApplication 00007ff6e9442ec0>
;   Document (RO) = #<VLA-OBJECT IAcadDocument 00000271bad76f38>
;   EntityTransparency = "PorCapa"
;   Handle (RO) = "7876"
;   HasExtensionDictionary (RO) = -1
;   Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 00000271d3154208>
;   Layer = "PS_Shape"
;   Linetype = "ByLayer"
;   LinetypeScale = 1.0
;   Lineweight = -1
;   Material = "ByLayer"
;   ObjectID (RO) = 42
;   ObjectName (RO) = "Ks_Shape"
;   OwnerID (RO) = 44
;   PlotStyleName = "ByLayer"
;   TrueColor = #<VLA-OBJECT IAcadAcCmColor 00000271d31545c0>
;   Visible = -1
; Métodos soportados:
;   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 ()

None of these properties or methods give me some interesting info. 

 

I'm very lose with this issue.

 

It's important to explain that the object are a bentley object from ProStructure and is possible to manage by Object enable software... 

 

Best regards

0 Likes
610 Views
10 Replies
Replies (10)
Message 2 of 11

devitg
Advisor
Advisor

@juanraXSVE3 , you can use this system variables to save all textscreen to a  logfile , and retrieve it  

LOGFILEMODE  


LOGFILENAME


LOGFILEPHAT

 

 

0 Likes
Message 3 of 11

Sea-Haven
Mentor
Mentor

Post a sample dwg so people can look inside object.

0 Likes
Message 4 of 11

juanraXSVE3
Participant
Participant

Hi @devitg.

Thanks for your answer.

This solution is not the best solution because I need the info on the same session. If i'm not wrong, the Log File only created when the file is closed.

But I think your way of solving the problem is correct. 

 

Regards!

0 Likes
Message 5 of 11

juanraXSVE3
Participant
Participant

Attach dwg file with a example. For open and see the elements you need a Object Enable autocad 2020 from bentley.

 

Thanks! 

0 Likes
Message 6 of 11

Kent1Cooper
Consultant
Consultant

@juanraXSVE3 wrote:

....

I tried to get the info with entget(it's not enought)

((-1 . <Nombre entidad: 271b8e24660>) (0 . "KS_SHAPE") (5 . "7876") (102 . "{ACAD_XDICTIONARY") (360 . <Nombre entidad: 271ba8d6b50>) (102 . "}") (330 . <Nombre entidad: 271b8e0f6c0>) (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "PS_Shape"))

....


[Does ProStructure have a Forum?]

 

I see there are other entity names embedded in the entity data list from (entget).  What happens if you try getting the entity data from one of those?

 

(entget (cdr (assoc 360 (entget (car (entsel "\nSelect the object: "))))))

 

And similarly with 330.

 

Either of those might contain further-nested entity names that you may need to investigate....

Kent Cooper, AIA
0 Likes
Message 7 of 11

Sea-Haven
Mentor
Mentor

The basic steel :I" beam in the dwg it may be possible to get some details but the other 3d part full of 3d shapes is probably a ASIC model and way to hard to pull apart easily, need someone who has programming experience with modles of that type.

 

What are you really after just a box size ? Your list in 1st post is massive.

0 Likes
Message 8 of 11

juanraXSVE3
Participant
Participant
I don't find any ProStructure Forum for developers.
I tried to get info with 360 and 330 entity name. I wrote this code:


(defun readitems (it / lst)
(print it)
(foreach i it
(if (or(=(car i)330)(=(car i)330))
(progn
(print (entget(cdr i)))
(readitems (entget(cdr i))))))

)

The idea was get all 330 entity name and 360 entity name from the object. But, when I run the code, it doesn't stop it... If I only get 330 entities names, I get this:

((-1 . <Nombre entidad: 1aeb9651d30>) (0 . "KS_PLATE") (330 . <Nombre entidad: 1aeb590aec0>) (5 . "968B") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "PS_Plate"))
((-1 . <Nombre entidad: 1aeb590aec0>) (0 . "BLOCK_RECORD") (5 . "6C") (102 . "{ACAD_XDICTIONARY") (360 . <Nombre entidad: 1aeb590f980>) (102 . "}") (330 . <Nombre entidad: 1aeb590a810>) (100 . "AcDbSymbolTableRecord") (100 . "AcDbBlockTableRecord") (2 . "*Model_Space") (360 . <Nombre entidad: 1aeb590aed0>) (340 . <Nombre entidad: 1aeb590aef0>) (70 . 0) (280 . 1) (281 . 0))
((-1 . <Nombre entidad: 1aeb590aec0>) (0 . "BLOCK_RECORD") (5 . "6C") (102 . "{ACAD_XDICTIONARY") (360 . <Nombre entidad: 1aeb590f980>) (102 . "}") (330 . <Nombre entidad: 1aeb590a810>) (100 . "AcDbSymbolTableRecord") (100 . "AcDbBlockTableRecord") (2 . "*Model_Space") (360 . <Nombre entidad: 1aeb590aed0>) (340 . <Nombre entidad: 1aeb590aef0>) (70 . 0) (280 . 1) (281 . 0))
((-1 . <Nombre entidad: 1aeb590a810>) (0 . "TABLE") (2 . "BLOCK_RECORD") (330 . <Nombre entidad: 0>) (5 . "1") (100 . "AcDbSymbolTable") (70 . 106))
((-1 . <Nombre entidad: 1aeb590a810>) (0 . "TABLE") (2 . "BLOCK_RECORD") (330 . <Nombre entidad: 0>) (5 . "1") (100 . "AcDbSymbolTable") (70 . 106))

But I don't get interesting information.
0 Likes
Message 9 of 11

juanraXSVE3
Participant
Participant
I need geometrical info of each element to create a bounding box from these elements and the system
elements and bound the xref. I need to get the shape of the beam to draw parts of the ensemble
0 Likes
Message 10 of 11

Kent1Cooper
Consultant
Consultant

@juanraXSVE3 wrote:
I need geometrical info of each element to create a bounding box from these elements and the system
elements and bound the xref. I need to get the shape of the beam to draw parts of the ensemble

If you just want the bounding box of an overall thing, you can get that from the overall thing, rather than plowing through "geometrical info of each element":

 

(setq entityname (car (entsel))) ;; {select it}

(vla-getboundingbox (vlax-ename->vla-object EntityName) 'minpt 'maxpt)
(setq
  LL (vlax-safearray->list minpt)
  UR (vlax-safearray->list maxpt)
)

 

Then check the results:

Command: !LL
(-4570.19 -5238.37 6661.62)

Command: !UR
(-4420.19 -5098.98 6853.91)

Kent Cooper, AIA
0 Likes
Message 11 of 11

juanraXSVE3
Participant
Participant
Thank you for this option, Kent Cooper.
This is very helpful, but it's not the only info I need. I also need the relationship between the objects, the shape of all the beams and plates, the location of the holes... And all these info is on the first.

I'm work with your code to get the bounding box. Thanks! But I will looking for a other solution for get the rest of the info.

Regards!
0 Likes