From the course: Learning AutoLISP & Visual LISP

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Function: subst

Function: subst - AutoCAD Tutorial

From the course: Learning AutoLISP & Visual LISP

Start my 1-month free trial

Function: subst

- [Instructor] In addition to identifying or associating a specific value dotted pair in an entity data list we'll also want to substitute or change that value so we can change the value of the layer from layer zero to a different layer simply by using another LISP function called substitute. It manipulates a list but we're ultimately changing the entity and data while we do it. Let's go ahead and call that entity data two. We are going to substitute one dotted pair with a new one. Our new one is NEWLAYER. Our former dotted pair is the layer name. We're using associate to identify the dotted pair for layer in our entity data list and we also have to provide that as our argument. Our starting data list. The existing dotted pair that we are substituting. The new dotted pair that we're putting in there and that of course are the arguments. Let's go ahead and run all of this here. We select our entity and notice the value comes back. We now have a list here. Our entity data started off as…

Contents