Jump to content

dxf group pts, hard coded variables, sharp edges?


Recommended Posts

Posted

Hey folks

 

have three questions today hopefully you's can provide some insight into at least one of them

 

1. Once a list of points has been derived from a lwpolyline i'd like to use these points to select objects within the parameters of the entity whilch the points where derived from. I can't figure out how to enter all the points into a command. Can this be done or could someone provide an alternative method for this task>

 

2. At my work the rest of the staff use Anvil; an old tablet driven program for any 2D work. I don't have the eyesigth for effective use of the tablet or the will power to learn such a backward CAD package. Before creatingthe iges file the parts are set to levels (layers on Autocad) ranged from 11-49. Rather than having to hard code a variable for each program that requires at least one variable for each layer , for example a selection set for each. I was hoping there is a way to create the variables by use of a loop with a cntr?

 

3. Smartcam is not a big fan of sharp edge on profiles therefore there has to be a fillet on each corner or change in angle. is there a way to gather these points?

 

Any help will be greatly appreciated.

 

Thanks,

Ollie.

Posted

1. You need function like this:

 

(defun GetLwPolyVertexes(Ename)
 (mapcar 'cdr(vl-remove-if '(lambda(x)(/= 10(car x)))(entget Ename)))
 ); end of GetLwPolyVertexes

 

Try in command line:

 

Command: (GetLwPolyVertexes(car(entsel)))

Select object: ((-227861.0 168724.0) (-217784.0 173601.0) (-215580.0 167702.0) 
(-209597.0 168567.0) (-212746.0 174466.0) (-220855.0 178792.0) (-227074.0 
174702.0))

 

2. Variable for each layer? For example variable for layer 11:

 

(setq L11 (sssetfirst nil (ssget "_X" '((8 . "11")))))

Posted

Thanks for the input. I tried the first two and couldn't seem to get anything to happen iwith them. i've been using a pice of code to this effect to get the points


(setq Ent_group (entget(car(entsel))))

(foreach a Ent_group
  (if (= 10 (car a))
    (setq verlist(append verlist(list(cdr a))))
)

The main problem i am having is a can't create a fence selection from the points for example i thought this might have worked, it didn't

 


("command"move""f"verlist"")

As for the last part i was hoping you could elaborae on how it worked a bit, most of my lisp knowledge is based on excessive lengths of time using trial and error and i don't have a clue how i would implement such code. the the selection set i would be using for each layer would roughly be.

 

 

 

   (Setq break_check_10
          (ssget "x"
             '(
           (-4 . "<OR")
           (-4 . "<AND")
           (-4 . "<NOT")
           (0 . "MTEXT")
           (-4 . "NOT>")
           (-4 . "<NOT")
           (0 . "TEXT")
           (-4 . "NOT>")
           (-4 . "<NOT")
           (0 . "VIEWPORT")
           (-4 . "NOT>")
           (-4 . "AND>")
           (-4 . "OR>")
         )
       )
   )
 

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