Jump to content

Recommended Posts

Posted

Hey I wanted to write something like:

Copies polylines that are on layer WARSTWA1

(15,000 copies on the right)

Then added to select the objects you copied (preferably as a list)

Each copied then transform the region.

I'm trying to do something with "ssget" X "," but somehow this does not go

Help:)

Posted

15.000 Copies that may break down your Autocad program undoubtly.

Posted

15,000 copies sure is a lot. Are these closed polylines? I ask because you mention transforming them (the 15,000 copies?) into regions.

 

What are you drawing? Can you post an example of what you want to start with and what you want the finished object to look like? One example of each will be sufficient. Thanks.

Posted

probably badly written.

It was a shift to the right of 15,000 units

 

(setq en (ssget "_x"

(list

(cons 0 "LWPOLYLINE")

(cons 8 (strcat "WARSTWA1" "*"))

)

)

 

(command "._copy" en "" "m" "0,0,0" "50000,0,0" "E")

Posted

15,000 units? Metric or Imperial?

 

Shift as in move? It looks like you are using the copy command not the move command.

 

Sorry, I'm still not following you.

 

And what about using Region? Where does that come in?

Posted

may be something like this ....

 

(setq ss (ssget "_x" '((0 . "LWPOLYLINE")(cons 8 (strcat "XXX" "*")))))
(command "_.copy" ss "" '(0. 0. 0.) (polar '(0. 0. 0.) 0.0 15000.))

Posted

Language problems:)

So yes, I want to do something like this:

I emphasize that all the polylines on layer xxx.

I have a list of variables (the selected polylines).

Each element of the copies of 15000 mm to the right.

copied item transform the region and adds to the list (variable).

Each item in this list sequentially stretch(extrude) (solid 3d) 500 mm perpendicularly to the model

Posted (edited)

This?

 

(defun c:test ( / doc spc ss n r ) (vl-load-com)
 ;; Example by Lee Mac 2010  www.lee-mac.com

 (setq spc
   (vlax-get-property (setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
     (if (= 1 (getvar 'CVPORT)) 'PaperSpace 'ModelSpace)
   )
 )

 (if (ssget "_X" '((0 . "LWPOLYLINE") (8 . "XXX*")))
   (progn
     (vlax-for o (setq ss (vla-get-ActiveSelectionSet doc))
       (vla-move (setq n (vla-copy o))
         (vlax-3D-point '(0. 0. 0.)) (vlax-3D-point '(15000. 0. 0.))
       )
       (vla-put-closed n :vlax-true)
       (vla-AddExtrudedSolid spc (car (setq r (vlax-invoke spc 'AddRegion (list n)))) 500. 0.)
       (vla-delete n)
       (mapcar 'vla-delete r)
     )
     (vla-delete ss)
   )
   (princ "\n** No LWPolylines Found **")
 )
 (princ)
)

Edited by Lee Mac
Posted

Thanks that's it. An awful lot here, "vla". You will have to train a little bit to understand the code. Thank you very much. Maybe one more question:

What commands add or cut a solid 3d

Posted (edited)

To add to the list of created shape.

I mean somewhere that can later be appealed to the variable.

For example, an object X, rotate 90 degrees

 

How to remove the region after the establishment were

Edited by jan_ek
Posted
How to remove the region after the establishment were

 

Updated.

 

123

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