Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Field suffix in Table
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: Field suffix in Table (Read 2255 times)
0 Members and 1 Guest are viewing this topic.
REGHUYES
Newt
Posts: 21
Field suffix in Table
«
on:
January 09, 2014, 08:32:23 AM »
This is Lee Mac's code .Is it possible to add "Sq m" suffix for field.Iam begineer to Auto lisp
Code - Auto/Visual Lisp:
[Select]
(
defun
c:sCell
(
/
tab ent Obj pt tObj row col
)
(
vl-load-com
)
(
if
(
and
(
setq
tab
(
car
(
entsel
"
\n
Select Table: "
)
)
)
(
eq
"ACAD_TABLE"
(
cdr
(
assoc
0
(
entget
tab
)
)
)
)
)
(
while
(
and
(
setq
ent
(
car
(
entsel
"
\n
Select Room: "
)
)
)
(
vlax-property-available-p
(
setq
Obj
(
vlax
-
ename
->
vla-object
ent
)
)
'Area
)
)
(
while
(
progn
(
setq
pt
(
getpoint
"
\n
Click into Cell to place field: "
)
)
(
cond
(
(
vl-consp
pt
)
(
if
(
eq
:vlax-true
(
vla
-
hittest
(
setq
tObj
(
vlax
-
ename
->
vla-object
tab
)
)
(
vlax-3D-point
pt
)
(
vlax-3D-point
(
trans
'
(
0
0
1
)
0
1
)
)
'row 'col
)
)
nil
(
princ
"
\n
** No Cell Selected **"
)
)
)
(
t
(
princ
"
\n
** No Point Selected **"
)
)
)
)
)
(
vla
-
setText tObj row col
(
strcat
"%<
\\
AcObjProp Object(%<
\\
_ObjId "
(
vl-princ-to-string
(
vla-get-Objectid
Obj
)
)
">%).Area
\\
f
\"
%lu2%pr2
\"
>%"
)
)
)
(
princ
"
\n
** No Table Selected **"
)
)
(
princ
)
)
«
Last Edit: January 09, 2014, 08:36:39 AM by REGHUYES
»
Logged
ronjonp
Needs a day job
Posts: 7529
Re: Field suffix in Table
«
Reply #1 on:
January 09, 2014, 11:08:35 AM »
Not tested but maybe change this:
">%).Area \\f \"%lu2%pr2\">%"
to
">%).Area \\f \"%lu2%pr2
%ps[,SQ m]
\">%"
Logged
Windows 11 x64 - AutoCAD /C3D 2023
Custom Build PC
REGHUYES
Newt
Posts: 21
Re: Field suffix in Table
«
Reply #2 on:
January 09, 2014, 10:47:25 PM »
Thank u "ronjonp" sir.
How to select two or more rooms.
reference image attached
«
Last Edit: January 15, 2014, 11:37:59 PM by REGHUYES
»
Logged
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Field suffix in Table