Lisp to export lines colors and texts beside them to excel

Lisp to export lines colors and texts beside them to excel

hythamthelove
Advocate Advocate
2,136 Views
23 Replies
Message 1 of 24

Lisp to export lines colors and texts beside them to excel

hythamthelove
Advocate
Advocate

Hello everyone,

i want a lisp to export all selected lines colors and also export texts beside them to excel. You can find below photos of the lines and texts in autocad and the table i want in excel, also DWG file will be attached for reference. If it is hard to get texts beside the lines, i could move texts to be in the line itself.

Thanks in advance

 

hythamthelove_0-1654977059506.pnghythamthelove_1-1654977084586.png

 

0 Likes
Accepted solutions (1)
2,137 Views
23 Replies
Replies (23)
Message 21 of 24

ВeekeeCZ
Consultant
Consultant

No, no. I know. But I need something else.

 

Copy-paste this line into the command line, hit enter:

(dumpallproperties (car (entsel)))

 

and select polyline with index color.

 

Then this line, select again pl with index color.

(getpropertyvalue (car (entsel)) "Color")

 

Then this and again the second one on pl with Truecolor.

(dumpallproperties (car (entsel)))

(getpropertyvalue (car (entsel)) "Color")

 

Then post the listing of all 4 here.

0 Likes
Message 22 of 24

hythamthelove
Advocate
Advocate

Ok i understood, as soon as i reach my laptop i will give you the results you want

0 Likes
Message 23 of 24

hythamthelove
Advocate
Advocate

With Index Color:

Command: (dumpallproperties (car (entsel)))
Select object: Begin dumping object (class: AcDbPolyline)
Annotative (type: bool) (LocalName: Annotative) = Failed to get value
AnnotativeScale (type: AcString) (RO) (LocalName: Annotative scale) = Failed to get value
Area (type: double) (RO) (LocalName: Area) = 0.000000
BlockId (type: AcDbObjectId) (RO) = 222d88bb820
CastShadows (type: bool) = 0
ClassName (type: AcString) (RO) =
Closed (type: bool) (LocalName: Closed) = 0
CollisionType (type: AcDb::CollisionType) (RO) = 1
Color (type: AcCmColor) (LocalName: Color) = blue
ConstantWidth (type: double) (LocalName: Global width) = 30.000000
Elevation (type: double) (LocalName: Elevation) = 0.052976
EndParam (type: double) (RO) = 1.000000
EndPoint/X (type: double) (RO) (LocalName: End X) = Failed to get value
EndPoint/Y (type: double) (RO) (LocalName: End Y) = Failed to get value
EndPoint/Z (type: double) (RO) (LocalName: End Z) = Failed to get value
ExtensionDictionary (type: AcDbObjectId) (RO) = 0
Handle (type: AcDbHandle) (RO) = 10f3a6
HasBulges (type: bool) (RO) = 0
HasFields (type: bool) (RO) = 0
HasSaveVersionOverride (type: bool) = 0
HasWidth (type: bool) (RO) = 1
Hyperlinks (type: AcDbHyperlink*)
IsA (type: AcRxClass*) (RO) = AcDbPolyline
IsAProxy (type: bool) (RO) = 0
IsCancelling (type: bool) (RO) = 0
IsEraseStatusToggled (type: bool) (RO) = 0
IsErased (type: bool) (RO) = 0
IsModified (type: bool) (RO) = 0
IsModifiedGraphics (type: bool) (RO) = 0
IsModifiedXData (type: bool) (RO) = 0
IsNewObject (type: bool) (RO) = 0
IsNotifyEnabled (type: bool) (RO) = 0
IsNotifying (type: bool) (RO) = 0
IsObjectIdsInFlux (type: bool) (RO) = 0
IsOnlyLines (type: bool) (RO) = 0
IsPeriodic (type: bool) (RO) = 0
IsPersistent (type: bool) (RO) = 1
IsPlanar (type: bool) (RO) = 1
IsReadEnabled (type: bool) (RO) = 1
IsReallyClosing (type: bool) (RO) = 1
IsTransactionResident (type: bool) (RO) = 0
IsUndoing (type: bool) (RO) = 0
IsWriteEnabled (type: bool) (RO) = 0
LayerId (type: AcDbObjectId) (LocalName: Layer) = 222d88bb870
Length (type: double) (RO) (LocalName: Length) = 3180.924914
LineWeight (type: AcDb::LineWeight) (LocalName: Lineweight) = -1
LinetypeId (type: AcDbObjectId) (LocalName: Linetype) = 222e1c29a40
LinetypeScale (type: double) (LocalName: Linetype scale) = 1.000000
LocalizedName (type: AcString) (RO) = Polyline
MaterialId (type: AcDbObjectId) (LocalName: Material) = 222d88bebd0
MergeStyle (type: AcDb::DuplicateRecordCloning) (RO) = 1
Normal/X (type: double) = 0.000000
Normal/Y (type: double) = 0.000000
Normal/Z (type: double) = 1.000000
ObjectId (type: AcDbObjectId) (RO) = 222e1c3d9e0
OwnerId (type: AcDbObjectId) (RO) = 222d88bb820
Plinegen (type: bool) (LocalName: Linetype generation) = 0
PlotStyleName (type: AcString) (RO) (LocalName: Plot style) = ByColor
ReceiveShadows (type: bool) = 0
ShadowDisplay (type: AcDb::ShadowFlags) (RO) (LocalName: Shadow Display) = Failed to get value
StartParam (type: double) (RO) = 0.000000
StartPoint/X (type: double) (RO) (LocalName: Start X) = Failed to get value
StartPoint/Y (type: double) (RO) (LocalName: Start Y) = Failed to get value
StartPoint/Z (type: double) (RO) (LocalName: Start Z) = Failed to get value
Thickness (type: double) (LocalName: Thickness) = 0.000000
Transparency (type: AcCmTransparency) (LocalName: Transparency) = 0
Vertices (type: AcDbPolylineVertex)
Item 0:
Bulge (type: double) = Failed to get value
ClassName (type: AcString) (RO) =
EndWidth (type: double) (LocalName: End segment width) = Failed to get value
Id (type: int) = Failed to get value
IsA (type: AcRxClass*) (RO) = AcRxBoxedValueOnStack
LocalizedName (type: AcString) (RO) =
Position/X (type: double) (LocalName: Vertex X) = Failed to get value
Position/Y (type: double) (LocalName: Vertex Y) = Failed to get value
StartWidth (type: double) (LocalName: Start segment width) = Failed to get value
Item 1:
Bulge (type: double) = Failed to get value
ClassName (type: AcString) (RO) =
EndWidth (type: double) (LocalName: End segment width) = Failed to get value
Id (type: int) = Failed to get value
IsA (type: AcRxClass*) (RO) = AcRxBoxedValueOnStack
LocalizedName (type: AcString) (RO) =
Position/X (type: double) (LocalName: Vertex X) = Failed to get value
Position/Y (type: double) (LocalName: Vertex Y) = Failed to get value
StartWidth (type: double) (LocalName: Start segment width) = Failed to get value
Visible (type: AcDb::Visibility) = 0
End object dump
nil
Command: (getpropertyvalue (car (entsel)) "Color")
Select object: "5"

 

 

Message 24 of 24

hythamthelove
Advocate
Advocate

With True color

 

Command: (dumpallproperties (car (entsel)))
Select object: Begin dumping object (class: AcDbPolyline)
Annotative (type: bool) (LocalName: Annotative) = Failed to get value
AnnotativeScale (type: AcString) (RO) (LocalName: Annotative scale) = Failed to get value
Area (type: double) (RO) (LocalName: Area) = 0.000000
BlockId (type: AcDbObjectId) (RO) = 222d88bb820
CastShadows (type: bool) = 0
ClassName (type: AcString) (RO) =
Closed (type: bool) (LocalName: Closed) = 0
CollisionType (type: AcDb::CollisionType) (RO) = 1
Color (type: AcCmColor) (LocalName: Color) = 247,242,129
ConstantWidth (type: double) (LocalName: Global width) = 100.000000
Elevation (type: double) (LocalName: Elevation) = 0.052976
EndParam (type: double) (RO) = 1.000000
EndPoint/X (type: double) (RO) (LocalName: End X) = Failed to get value
EndPoint/Y (type: double) (RO) (LocalName: End Y) = Failed to get value
EndPoint/Z (type: double) (RO) (LocalName: End Z) = Failed to get value
ExtensionDictionary (type: AcDbObjectId) (RO) = 0
Handle (type: AcDbHandle) (RO) = 10f3b5
HasBulges (type: bool) (RO) = 0
HasFields (type: bool) (RO) = 0
HasSaveVersionOverride (type: bool) = 0
HasWidth (type: bool) (RO) = 1
Hyperlinks (type: AcDbHyperlink*)
IsA (type: AcRxClass*) (RO) = AcDbPolyline
IsAProxy (type: bool) (RO) = 0
IsCancelling (type: bool) (RO) = 0
IsEraseStatusToggled (type: bool) (RO) = 0
IsErased (type: bool) (RO) = 0
IsModified (type: bool) (RO) = 0
IsModifiedGraphics (type: bool) (RO) = 0
IsModifiedXData (type: bool) (RO) = 0
IsNewObject (type: bool) (RO) = 0
IsNotifyEnabled (type: bool) (RO) = 0
IsNotifying (type: bool) (RO) = 0
IsObjectIdsInFlux (type: bool) (RO) = 0
IsOnlyLines (type: bool) (RO) = 0
IsPeriodic (type: bool) (RO) = 0
IsPersistent (type: bool) (RO) = 1
IsPlanar (type: bool) (RO) = 1
IsReadEnabled (type: bool) (RO) = 1
IsReallyClosing (type: bool) (RO) = 1
IsTransactionResident (type: bool) (RO) = 0
IsUndoing (type: bool) (RO) = 0
IsWriteEnabled (type: bool) (RO) = 0
LayerId (type: AcDbObjectId) (LocalName: Layer) = 222e1c33a00
Length (type: double) (RO) (LocalName: Length) = 3180.924914
LineWeight (type: AcDb::LineWeight) (LocalName: Lineweight) = -1
LinetypeId (type: AcDbObjectId) (LocalName: Linetype) = 222e1c339e0
LinetypeScale (type: double) (LocalName: Linetype scale) = 2.000000
LocalizedName (type: AcString) (RO) = Polyline
MaterialId (type: AcDbObjectId) (LocalName: Material) = 222d88bebd0
MergeStyle (type: AcDb::DuplicateRecordCloning) (RO) = 1
Normal/X (type: double) = 0.000000
Normal/Y (type: double) = 0.000000
Normal/Z (type: double) = 1.000000
ObjectId (type: AcDbObjectId) (RO) = 222e1c3dad0
OwnerId (type: AcDbObjectId) (RO) = 222d88bb820
Plinegen (type: bool) (LocalName: Linetype generation) = 0
PlotStyleName (type: AcString) (RO) (LocalName: Plot style) = ByColor
ReceiveShadows (type: bool) = 0
ShadowDisplay (type: AcDb::ShadowFlags) (RO) (LocalName: Shadow Display) = Failed to get value
StartParam (type: double) (RO) = 0.000000
StartPoint/X (type: double) (RO) (LocalName: Start X) = Failed to get value
StartPoint/Y (type: double) (RO) (LocalName: Start Y) = Failed to get value
StartPoint/Z (type: double) (RO) (LocalName: Start Z) = Failed to get value
Thickness (type: double) (LocalName: Thickness) = 0.000000
Transparency (type: AcCmTransparency) (LocalName: Transparency) = 0
Vertices (type: AcDbPolylineVertex)
Item 0:
Bulge (type: double) = Failed to get value
ClassName (type: AcString) (RO) =
EndWidth (type: double) (LocalName: End segment width) = Failed to get value
Id (type: int) = Failed to get value
IsA (type: AcRxClass*) (RO) = AcRxBoxedValueOnStack
LocalizedName (type: AcString) (RO) =
Position/X (type: double) (LocalName: Vertex X) = Failed to get value
Position/Y (type: double) (LocalName: Vertex Y) = Failed to get value
StartWidth (type: double) (LocalName: Start segment width) = Failed to get value
Item 1:
Bulge (type: double) = Failed to get value
ClassName (type: AcString) (RO) =
EndWidth (type: double) (LocalName: End segment width) = Failed to get value
Id (type: int) = Failed to get value
IsA (type: AcRxClass*) (RO) = AcRxBoxedValueOnStack
LocalizedName (type: AcString) (RO) =
Position/X (type: double) (LocalName: Vertex X) = Failed to get value
Position/Y (type: double) (LocalName: Vertex Y) = Failed to get value
StartWidth (type: double) (LocalName: Start segment width) = Failed to get value
Visible (type: AcDb::Visibility) = 0
End object dump
nil
Command: (getpropertyvalue (car (entsel)) "Color")
Select object: "247,242,129"