| Author |
Message |
Clarence
Guest
|
Posted:
Fri Dec 17, 2004 11:04 pm Post subject:
Object ID for area field |
|
|
I am currently working on an autolisp command that will make an area field for a polyline. I have figured out everything except how to get and use the object id. I keep getting an error:
bad argument type: stringp 2128026136
That number is the object id, but I can't get the command to use it tho.
Can someone help please?!?!?!
here's the command:
(defun c:ASF (/ ent)
(command "undo" "g")
(setq olderr *error*)
(defun *error* (errmes)
(princ
(strcat "\n Area (Sq. Ft.) by Polyline halted by: \n"
errmes
)
)
(command "undo" "end")
(setq *error* olderr)
(command "undo" "1")
(prin1)
)
(vl-load-com)
(PROMPT "\n\nArea (S.F.) by Polyline....\n")
(setq setosm (getvar "osmode"))
(setvar "osmode" 16384)
(setq ent (vlax-ename->vla-object (car (entsel "pick"))))
(setq objidlwpoly (vla-get-objectid ent))
(setq atfield
(strcat
"%<\\AcObjProp Object(%<\\_ObjId "
objidlwpoly
">%).Area \\f \"%lu2%ct4%qf1 SQ. FT.\">%"
)
)
(command "mtext" pause pause atfield "")
(vlax-release-object ent)
(setvar "osmode" setosm)
(command "cmdecho" 1)
(setq *error* olderr)
(command "undo" "end")
(princ userobjid)
(princ)
)
|
|
| Back to top |
|
 |
BillZ
Guest
|
Posted:
Fri Dec 17, 2004 11:23 pm Post subject:
Re: Object ID for area field |
|
|
strcat expecta a string.
(itoa objidlwpoly)
Bill |
|
| Back to top |
|
 |
Jeff Mishler
Guest
|
Posted:
Fri Dec 17, 2004 11:24 pm Post subject:
Re: Object ID for area field |
|
|
ObjectID is an Integer........
--
Jeff
check out www.cadvault.com
"Clarence" <nospam@address.withheld> wrote in message
news:17205131.1103306729282.JavaMail.jive@jiveforum1.autodesk.com...
| Quote: | I am currently working on an autolisp command that will make an area field
for a polyline. I have figured out everything except how to get and use
the object id. I keep getting an error:
bad argument type: stringp 2128026136
That number is the object id, but I can't get the command to use it tho.
Can someone help please?!?!?!
here's the command:
(defun c:ASF (/ ent)
(command "undo" "g")
(setq olderr *error*)
(defun *error* (errmes)
(princ
(strcat "\n Area (Sq. Ft.) by Polyline halted by: \n"
errmes
)
)
(command "undo" "end")
(setq *error* olderr)
(command "undo" "1")
(prin1)
)
(vl-load-com)
(PROMPT "\n\nArea (S.F.) by Polyline....\n")
(setq setosm (getvar "osmode"))
(setvar "osmode" 16384)
(setq ent (vlax-ename->vla-object (car (entsel "pick"))))
(setq objidlwpoly (vla-get-objectid ent))
(setq atfield
(strcat
"%<\\AcObjProp Object(%<\\_ObjId "
objidlwpoly
">%).Area \\f \"%lu2%ct4%qf1 SQ. FT.\">%"
)
)
(command "mtext" pause pause atfield "")
(vlax-release-object ent)
(setvar "osmode" setosm)
(command "cmdecho" 1)
(setq *error* olderr)
(command "undo" "end")
(princ userobjid)
(princ)
) |
|
|
| Back to top |
|
 |
Clarence
Guest
|
Posted:
Fri Dec 17, 2004 11:28 pm Post subject:
Re: Object ID for area field |
|
|
I knew I was just overlooking something.....
Thank you thank you thank you!!!!!
BTW....its working GREAT!!!!!! |
|
| Back to top |
|
 |
BillZ
Guest
|
Posted:
Fri Dec 17, 2004 11:41 pm Post subject:
Re: Object ID for area field |
|
|
You're welcome,
Glad I could help.
Bill |
|
| Back to top |
|
 |
LUCAS
Guest
|
Posted:
Mon Dec 20, 2004 8:52 am Post subject:
Re: Object ID for area field |
|
|
http://new.cadalyst.com/code/browseyear.cfm?fullyear=2004#10
October 2004------Link Area Text to Boundary
"BillZ" <nospam@address.withheld> ¦b¶l¥ó
news:1758636.1103308894717.JavaMail.jive@jiveforum2.autodesk.com ¤¤¼¶¼g...
| Quote: | You're welcome,
Glad I could help.
Bill |
|
|
| Back to top |
|
 |
|
|
|
|