Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Distinguished Contributor
Tom_Berning
Posts: 160
Registered: ‎08-08-2006
Message 1 of 2 (157 Views)
Accepted Solution

Help to get routine to work in 2013

157 Views, 1 Replies
10-16-2012 02:32 PM

I don't do a lot of programming and when I do it is mostly with older lisp commands. I have routine that works in 2010 but we are switching to 2013 and it doesn't work. The routine assigns the area of a polyline to a field. The portion of the routine that isn't working is where it assigns the object id for the polyline. Here is that portion of the routine:

 

;; select an object
 (if (setq ent (entsel))
   (progn
     (setq ent (car ent))

;; Check to see if object selected is a polyline
     (if (= (cdr (assoc 0 (entget ent))) "LWPOLYLINE")
       (progn
;; obtain the object id from the selected entity
         (setq objID (vla-get-objectid (vlax-ename->vla-object ent)))

 

Any help would be appreciated

Thanks

Tom Berning
Woolpert, Inc.
Civil 3D 2013

Tom_Berning wrote:

I don't do a lot of programming and when I do it is mostly with older lisp commands. I have routine that works in 2010 but we are switching to 2013 and it doesn't work. The routine assigns the area of a polyline to a field. The portion of the routine that isn't working is where it assigns the object id for the polyline. Here is that portion of the routine:

get-objectid (vlax-ename->vla-object ent)))

 

Any help would be appreciated

Thanks


(setq objID
(if (> (vl-string-search "x64" (getvar "platform")) 0)
(vlax-invoke-method (vla-get-Utility (vla-get-activedocument (vlax-get-acad-object)))
"GetObjectIdString" (vlax-ename->vla-object ent) :vlax-False)
(itoa (vla-get-Objectid (vlax-ename->vla-object ent)))
)
)

 

HTH

*Expert Elite*
pbejse
Posts: 2,502
Registered: ‎11-24-2009
Message 2 of 2 (139 Views)

Re: Help to get routine to work in 2013

10-16-2012 06:41 PM in reply to: Tom_Berning

Tom_Berning wrote:

I don't do a lot of programming and when I do it is mostly with older lisp commands. I have routine that works in 2010 but we are switching to 2013 and it doesn't work. The routine assigns the area of a polyline to a field. The portion of the routine that isn't working is where it assigns the object id for the polyline. Here is that portion of the routine:

get-objectid (vlax-ename->vla-object ent)))

 

Any help would be appreciated

Thanks


(setq objID
(if (> (vl-string-search "x64" (getvar "platform")) 0)
      (vlax-invoke-method (vla-get-Utility (vla-get-activedocument (vlax-get-acad-object)))
	"GetObjectIdString" (vlax-ename->vla-object ent) :vlax-False)
      (itoa (vla-get-Objectid (vlax-ename->vla-object ent)))
    )
      )

 

HTH

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!