Anyone see a way to improve this ?
(SETQ ms (CADR (ASSOC -3
(ENTGET (CAR (ENTSEL "\nSelect Entity to extract XData : "))
'("TSD617_ML")
)
)
)
)
;|
("TSD617_ML"
(1000 . "HeaderHeight,40.000000")
(1000 . "ListHeight,80.000000")
(1000 . "TextHeight,35.000000")
(1000 . "Direction,90.000000")
(1000 . "ml_MemberMark,300.000000,L")
(1000 . "ml_ItemTag,300.000000,C")
(1000 . "ml_Quantity,150.000000,C")
(1000 . "ml_Description,700.000000,L")
(1000 . "ml_Length,200.000000,R")
(1000 . "ml_Remark,500.000000,C")
(1000 . "ml_ItemMass,200.000000,R")
(1000 . "ml_MemeberMass,200.000000,R")
)
|;
(MAPCAR '(LAMBDA (x)
(MAPCAR '(LAMBDA (s / tmp)
(IF (NUMBERP (SETQ tmp (READ s)))
tmp
s
)
)
(KDUB:string->strlist (CDR x) ", ")
)
)
(CDR ms)
)
;|
(("HeaderHeight" 40.0)
("ListHeight" 80.0)
("TextHeight" 35.0)
("Direction" 90.0)
("ml_MemberMark" 300.0 "L")
("ml_ItemTag" 300.0 "C")
("ml_Quantity" 150.0 "C")
("ml_Description" 700.0 "L")
("ml_Length" 200.0 "R")
("ml_Remark" 500.0 "C")
("ml_ItemMass" 200.0 "R")
("ml_MemeberMass" 200.0 "R")
)
|;
Generic Library stuff to split the CSV :
(DEFUN KDUB:string->strlist (searchstring delimstring
/ tempstring
index tempchar
returnlist delimchars
)
(SETQ delimchars (VL-STRING->LIST delimstring)
tempstring ""
index (1+ (STRLEN searchstring))
)
(WHILE (> (SETQ index (1- index)) 0)
(SETQ tempchar (SUBSTR searchstring index 1))
(IF (VL-POSITION (ASCII tempchar) delimchars)
(IF (/= tempstring "")
(SETQ returnlist (CONS tempstring returnlist)
tempstring ""
)
)
(SETQ tempstring (STRCAT tempchar tempstring))
)
)
(IF (/= tempstring "")
(CONS tempstring returnlist)
returnlist
)
)
and no Glenn, 'use C#' doesn't count