Jump to content

Recommended Posts

Posted

Hi,

 

As you'll probably realise, I'm new to AutoLISP and LISP in general. The function I'm trying to write selects the text on a layer and changes its style. Unfortunately, I'm getting nowhere through trial and error, so I'm resorting to your help. I'm sure the problem lies with my poor knowledge of the data types.

 

Here's a basic version of the program:

 

(defun C:cts () 
(vl-load-com)
(setq sel1 (ssget "X" '((8 . "Levels")(0 . "TEXT"))))
(vlax-put-property sel1 'StyleName "NORMAL")
(princ)
)

 

I had tried a combination of vlax-for, vlax-ename->vla-object, but I'm starting to think this approach isn't possible and I need a new approach. Any help would be greatly appreciated. Apologies for the terrible code.

Posted

Why don't you search for previously written lisp routines that do the exact same thing and see how the authors handled it in their code?

Posted
I had tried a combination of vlax-for, vlax-ename->vla-object, but I'm starting to think this approach isn't possible and I need a new approach.

 

See this tutorial for how to process your selection set sel1; you might also find this recent thread useful.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...