Jump to content

Recommended Posts

Posted

hey guys!

 

So i'm trying to build a lisp that will prompt the user to select some objects, filter out which ones are polylines and resize the width of the polylines.

 

I am able to get it to iterate through the selection but I am having a hard time with getting it to filter out polylines.

 

Any and all help is appreciated!

 

(I have ;;; where my attempt was to figure it out on my own)

 

(defun c:test (/)

 (setq a (ssget))

 (setq counter 0)

 ;;;(setq b (ssname a counter))

 (while (< counter (sslength a))

   ;;;add of object is not a polyline, skip

 ;;;(setq blist (entget b))

 ;;;(setq bname (cdr(assoc 0 (ssname b counter))))

 ;;;(if (= (cdr(assoc 0 (b))) "POLYLINE")

   ;;;(progn

 (command "pedit" (ssname a counter) "width" 1 "")

 (setq counter (+ counter 1))

   ;;;;end progn
   
   ;;;(setq counter (+ counter 1))
   ;;;;end if

  );;end while

 );;end defun

Posted

I haven't error checked my code or done the variable list at the start yet, was saving it until I've figured out this piece of the code.

Posted

An example of directly changing a pline width rather than use pedit.

 

(setq obj (vlax-ename->vla-object (car (entsel "\nPick Pline"))))
(val-put-constantwidth obj val) ; val is the width of the pline

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...