Get dimension txt from a certain layer

Get dimension txt from a certain layer

ki76EPG
Explorer Explorer
234 Views
1 Reply
Message 1 of 2

Get dimension txt from a certain layer

ki76EPG
Explorer
Explorer

I can´t get dimension text for variable "H0". It´s the only object that's in the current layer "Z-Højde".

 

Code:

(vl-load-com)
(defun c:insDat (/ ms nf nc pt numrows rowh colw mytab)
(princ "\nEnter Enter Data in the Table...:")

(setq H0 (ssget "_X" '((-4 . "<or")(8 . "Z-Højde")(-4 . "or>"))))
(sssetfirst nil H0)


(princ "\nEnter Nu er højde hentet...:")
(setq LÆ (getint "\nENTER VALUE LÆNGDE:"))
(setq TY (getint "\nENTER VALUE TYKKELSE:"))
(setq AN (getint "\nENTER VALUE ANTAL:"))
(setq VE (getstring "\nENTER TEXT VENDEELEMENT:"))
(setq EM (getstring "\nENTER TEXT EMNE:"))
(setq SA (getint "\nENTER VALUE SAGSNR:"))
(setq VÆT (getint "\nENTER VALUE VÆGT TOTAL:"))
(setq VÆF (getint "\nENTER VALUE VÆGT FORPLADE:"))
(setq VÆB (getint "\nENTER VALUE VÆGT BAGPLADE:"))
(setq BU (getint "\nENTER VALUE BUNDEN ARM:"))
(setq NE (getint "\nENTER VALUE NET:"))
(setq EK (getint "\nENTER VALUE EKSP.KL:"))

(Setq ms
(vla-get-Modelspace (vla-get-ActiveDocument (vlax-get-acad-object)))
nf 15
nc 3
pt (getpoint "\nData Table Insertion Point: ")
rowh 350
colW 1800
)
(setq mytab (vla-addtable ms (vlax-3d-point pt) nf nc rowh ColW))
;Nfila,NColum,alt.Celda,ancho de celda
(vla-setcolumnwidth mytab 0 600)
(vla-put-StyleName mytab "Standard")
(vla-put-HorzCellMargin mytab 50)
(vla-SetTextHeight mytab (+ acDataRow acHeaderRow acTitleRow) 121.25)
(vla-SetAlignment mytab acDataRow acmiddleleft)
(vla-SetText mytab 0 0 "INFORMATIONER")
(vla-SetText mytab 1 0 "Pos.:")
(vla-SetText mytab 1 1 "EMNE")
(vla-SetText mytab 1 2 "VÆRDI")
(vla-SetText mytab 2 1 "H0JDE")
(vla-settext mytab 2 2 (itoa H0))
(vla-SetText mytab 3 1 "LÆNGDE")
(vla-settext mytab 3 2 (itoa LÆ))
(vla-SetText mytab 4 1 "TYKKELSE")
(vla-settext mytab 4 2 (itoa TY))
(vla-SetText mytab 5 1 "ANTAL")
(vla-settext mytab 5 2 (itoa AN))
(vla-SetText mytab 6 1 "VENDEELEMENT")
(vla-SetText mytab 6 2 VE)
(vla-SetText mytab 7 1 "EMNE")
(vla-SetText mytab 7 2 EM)
(vla-SetText mytab 8 1 "SAGSNR")
(vla-SetText mytab 8 2 (itoa SA))
(vla-SetText mytab 9 1 "VÆGT TOTAL")
(vla-SetText mytab 9 2 (itoa VÆT))
(vla-SetText mytab 10 1 "VÆGT FORPLADE")
(vla-SetText mytab 10 2 (itoa VÆF))
(vla-SetText mytab 11 1 "VÆGT BAGPLADE")
(vla-SetText mytab 11 2 (itoa VÆB))
(vla-SetText mytab 12 1 "BUNDEN ARM:")
(vla-SetText mytab 12 2 (itoa BU))
(vla-SetText mytab 13 1 "NET")
(vla-SetText mytab 13 2 (itoa NE))
(vla-SetText mytab 14 1 "EKSP.KL")
(vla-SetText mytab 14 2 (itoa EK))
(vlax-release-object mytab)
)

0 Likes
Accepted solutions (1)
235 Views
1 Reply
Reply (1)
Message 2 of 2

Sea-Haven
Mentor
Mentor
Accepted solution

When you do the ssget you may get multiple answers, just a comment.

 

So if we look at (setq ho (ssname ss 0)) 1st entry will return the entity name not the entity properties <Entity name: 6821a500> need to dig deeper into the entity.

 

For all your getstring and getint have a look at my Multigetvals.lsp, read line 16 for your variables.

 

 

(setq obj (vlax-ename->vla-object (ssname ss 0)))
(setq ho (vla-get-Measurement obj)) ; this can be a real value 

 

 

 

 

 

0 Likes