Jump to content

Need a LISP routine to select lines and copy them to a block


gtwatson

Recommended Posts

I have ACAD 2006 but we just bought 2012. I do transmission towers and need to cut 3D planes for sections. My structural program outputs a 3d DXF file which consists of lines in 3D space. I was able to do this manually in 2006 using the 3 points from the UCS to make the UCS based on 3 selected points, then I did a filter on the properties and selected the lines that reside on the new plane but I had trouble getting the start and endpoints for the lines manually with the filter. I can't seem to find out how to do the filter in 2012 so I thought a LISP routine would do the trick.

 

What I need is to be able to select 3 points on my 3D model (all lines no solids at all and no text), filter through the lines and select only those that have a start Z coordinate and an end Z coordinate equal to zero (so that only lines that reside on my new plane are selected), then I would like to copy the selection set to a new layer, make a block out of it, save the block so I can paste it to a new drawing. I don’t want to remove the lines from the original 3D model, but they could be put on the new named layer so I could turn them off or hide them later.

 

After running the lisp routine, I will annotate the lines and put some dimensions on them manually. This will be used to send to a Transmission Tower detailer as a schematic telling him the angle size, number of bolts and number of holes-out in the angles.

 

Any help would be much appreciated. I attached a ZIP of the DXF because it was too big so you can see what I am working with.

 

I got some help here with a LISP routine I wrote several years ago to put numbers in circles, but my autolisp skills have deteriorated since the mid 1980's.

 

 

 

Thanks;

 

George

crossing 9x13-ng.zip

Link to comment
Share on other sites

You could do it by setting the ucs then selecting all entities but only copy the ones that have a z value of 0.0

Something like need to use ssget to pick multi lines (ssget "W" ) window option then sslength for how many objects

 

 (setq ss (ssget "W" ) ;window option 
(setq n (sslength ss)) ; for how many objects
(repeat n 
(setq objname (ssname n))
(setq tpp1 (entget objname)))
(setq endpt1 (cdr (assoc 10 tpp1))) 
(setq zval (caddr endpt1))
(if (= zval 0.0) do something here

)

    

Link to comment
Share on other sites

I tried to use a QSELECT and Filter but am not getting anywhere in selecting my plane using 3 points. I can use UCS and select 3 points and the icon goes to the point I want. When I try to select lines that lie on this new plane, I don't get the results I expected. When I select a new UCS, does ACAD transform the start and end coordinates to my new plane? When I pick a QSELECT for lines with Z=0, I don't seem to get the lines on my plane to be selected.

 

AFA the code BIGAL posted, I don't know enough lisp to make it do anything. I did add a defun to the top but then I got stuck with my plane and UCS.

Link to comment
Share on other sites

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