AutoCAD Map 3D Developer
Welcome to Autodesk’s AutoCAD Map 3D Developer Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D Developer topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Vlisp OD

2 REPLIES 2
Reply
Message 1 of 3
mfernandes
544 Views, 2 Replies

Vlisp OD

I have a very old LISP program, badly written I must say.

anyway it crashes in Map2013 after a number of "Invalid record number"

 

I narrowed it down to commands that are reading and writting object data as the possiable culprit

where can I find info on the the syntax for the following commands.

 

ade_odgetfield

ade_odaddrecord

ade_odsetfield

 

 

 

;Get all closed plines and write pline data to everything inside them
(defun c:pl-data ()

  (setvar "cmdecho" 0)
  (setq pl-ss (ssget '((0 . "LWPOLYLINE") (8 . "LOT"))))
  ;(setq pl-ss (ssget))
  (if pl-ss
    (progn
      (setq pl-len (sslength pl-ss))
      (setq pl-cntr 0)
      (repeat pl-len
        (setq pl (ssname pl-ss pl-cntr))
	(setq name (ade_odgetfield pl "LOT" "LOTKEY" 0))
	(setq data (entget pl))
	(setq vertices (get-vertices data))
	;(draw-wp)
	(setq ss (ssget "WP" vertices))
	(if ss
	  (progn
	    (setq cntr 0)
	    (setq len (sslength ss))
	    (repeat len
	      (setq e (ssname ss cntr))
	      (if (ade_odgetfield e "LOT" "LOTKEY" 0)
					;check to see if CITY table already attached
		(progn			;if yes - set the field to l-num
		  (ade_odsetfield e "LOT" "LOTKEY" 0 name)
		  (command "change" e "" "p" "c" "bylayer" "")
		)
		(progn			;if not, attach the table then set field to l-num
		  (ade_odaddrecord e "LOT")
		  (ade_odsetfield e "LOT" "LOTKEY" 0 name)
		  (command "change" e "" "p" "c" "bylayer" "")
		)
	      )
	      (setq cntr (+ cntr 1))
	    );end repeat
	  );end progn
	);end if
	(setq pl-cntr (+ pl-cntr 1))
      );end 1st repeat
    );end progn
  );end if
)

 

2 REPLIES 2
Message 2 of 3
cjneper
in reply to: mfernandes

I believe these come from Four Dimension Technologies.

I have used some of these routines for working with object data.

 

Try this site, under the Autocad Map category:

 

http://www.4d-technologies.com/techcenter/index.htm

 

 

Message 3 of 3
Murph_Map
in reply to: cjneper

They are Autodesks lisp functions. In 2011 version in the help folder look for a chm named ACMAPLISP. Those functions are listed in there.

 

Murph
Supporting the troops daily.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost