Jump to content

OFFSET MULTIPLE OBJECTs ON A GIVEN POINT


notview

Recommended Posts

I can't find a lisp "Offset multiple objects on a given point".

 

Any generous help, I need offset like this: Select the objects (lines or polylines).

Get/pick a point. Ask object interval distance. Then, from the source object to

a picked point is the Distance to be filled up.

 

e.g.: Distance to be filled up is 101m.; Object interval distance is 2m. Then, from the source object up to distance 100m are now filled. It was only filled up to 100m because additional of 2m is 102m, it is now more than to the Distance to be filled.

Link to comment
Share on other sites

I can't find a lisp "Offset multiple objects on a given point".

 

Any generous help, I need offset like this: Select the objects (lines or polylines).

Get/pick a point. Ask object interval distance. Then, from the source object to

a picked point is the Distance to be filled up.

 

e.g.: Distance to be filled up is 101m.; Object interval distance is 2m. Then, from the source object up to distance 100m are now filled. It was only filled up to 100m because additional of 2m is 102m, it is now more than to the Distance to be filled.

maybe this one:

;; ARRANG by David Harrington

;;; Array objects at any angle at a giving distance

;;;

;;; Main Program

;;;

(defun c:ara (/ x ent ang num dist pt1 dist1 pt2 ang_error olcmdecho olosmode)

(defun ang_error (msg)

(if (or (= msg "Function cancelled") (/= msg "quit / exit abort"))

(princ (strcat "Error: " msg))

)

(command "._UNDO" "E" "UNDO" "")

(setvar "CMDECHO" olcmdecho)

(setvar "OSMODE" olosmode)

(setq *error* old_err

old_err nil

)

(princ)

)

(setq old_err *error*

*error* ang_error

)

(setq olosmode (getvar "OSMODE")

olcmdecho (getvar "CMDECHO")

)

(setvar "CMDECHO" 0)

(command "._UNDO" "BE")

(prompt "\n Arrang - Array objects at an angle")

(setq x 1)

(princ "\nSelect objects to Array: ")

(cond

((setq ent (ssget))

(initget 1)

(setq ang (getangle "\nAngle to array objects: "))

(initget 1)

(setq num (getint "\nNumber of objects to array: "))

(initget 1)

(setq dist (getdist "\nDistance between objects: "))

(setq pt1 (getvar "lastpoint"))

(setq dist1 dist)

(setq pt2 (polar pt1 ang dist1))

(setvar "osmode" 0)

(while (/= num x)

(command "._COPY" ent "" pt1 pt2)

(setq dist1 (+ dist dist1))

(setq pt2 (polar pt1 ang dist1))

(setq x (+ x 1))

)

)

)

(command "._UNDO" "E")

(setvar "OSMODE" olosmode)

(setvar "CMDECHO" olcmdecho)

(setq *error* old_err)

(princ)

)

(princ)

Link to comment
Share on other sites

It's good, but this is what I want.

After the select of object, no need to ask angle to array and number ofobjects to array.

Only DISTANCE BETWEEN OBJECTS (or objects interval) and the Perpendicular Distancebetween the picked point and object are needed.

Number of objects will be determined by: PERPENDICULAR DISTANCE FROM PICKEDPOINT TO THE OBJECT / DISTANCE BETWEEN OBJECTS.

The QUOTIENT (only whole number, forget the decimal) is the number ofobjects to be offset/filled.

The side where you make a picked point is the side where to make an offsetobjects.

Link to comment
Share on other sites

Until you find exactly what you are looking for maybe Lee Mac's custom lisp routine called Dynamic Offset would suffice. Check it out....http://lee-mac.com/dynamicoffset.html

 

CADstudio has a lisp utility called XOffset. "XOffset creates multiple offsets to the selected objects, in the specified distance. You can specify whether to make the offset inwards or outwards for the selected closed polylines. The offset is drawn in the current layer." Find it here....

 

http://www.cadstudio.cz/en/download.asp?file=XOffset

Edited by ReMark
Link to comment
Share on other sites

Nice custom lisp!

 

L.M., If you could make additional option Pick a point either inner or outer of the object, and from that object to the picked point will be filled up that depend on chosen offset distance. And that's great!!

Link to comment
Share on other sites

Well that is entirely up to Lee. He is under no obligation to do so. Can't say for sure when and if he may see/respond to this thread. You'll just have to be patient.

Link to comment
Share on other sites

Seeing how you have 55 posts you can PM him. Ask nicely. People who are demanding normally don't get very far around here. If he should decline just take it in stride. OK?

Link to comment
Share on other sites

And the question is.......? Sorry, but my telepathic powers are disrupted due to increased solar activity.

 

What lisp routine are you using?

Link to comment
Share on other sites

This moment, I'm using the Lee Mac lisp, DynOffV2-1. I just make assumption on the (N)umber of offset. If ever did dot filled the total length, I just run it again.. Enter..Select the last object & Enter..

Link to comment
Share on other sites

I see from the screen shot that you are using AutoCAD 2012. You are in Luck, because this is now part of the copy command!!!

See the links below:

http://autocadtips.wordpress.com/2011/03/24/autocad-2012-copy-tool-with-array-option/

http://autocadtips.wordpress.com/2011/03/24/autocad-2012-copy-with-array-fit/

 

~Greg

Link to comment
Share on other sites

Using array with associative set to on would be your best bet. After the fact you can make adjustments to the number of objects, or spacing, etc.

Link to comment
Share on other sites

@notview try this code

Function Syntax: caa

(defun cpar(
           / ss1 a d di n std
           )
(setq cmdo(getvar "cmdecho"))
;(command "_.ucs" "")
(setvar "cmdecho" 0)
(princ "\nCopy array:")
(setq ss1(ssget))
(setq p1(getpoint "First point: "))
(setq p2(getpoint p1 "Second point: "))
(if ca:distance
 (progn
  (setq  std (rtos ca:distance 2 4))
  (setq d(getdist (strcat "Distance between elements<"std ">: ")))
   (if  d
    (setq ca:distance d)
   )
 );end progn
 (setq ca:distance(getdist "Distance between elements: "))
);end if
(setq a(angle p1 p2))
(setq a(* (/ 180  pi) a))
(command "_.ucs" "z" a)
(setq di (distance p1 p2))
(setq d ca:distance)
(setq n(/ di d))
(setq n(+ 1(atoi (rtos n 2 1))))
(command "_.array" ss1 "" "r" 1 n d)
(command "_.ucs" "")
(setvar "cmdecho" cmdo)
(princ)
);end defun
(defun c:caa()
(cpar)
)

Link to comment
Share on other sites

Thank you Greg, I learned something an additional command using copy & array in cad.

Copy and option array was almost same to Lee Mac Lisp.

 

Thanx rkent for the ideas..

 

dvpluto, you are almost there!

This routine is asking two points and that is good. And asking for the distance between elements, copying an array and filled equally the picked two points.

After that, I noticed the interval or distance between elements was a bit changed.

 

If you could give me some favor, can you make some changes..

 

Pls., distance between elements is a parallel distance.

 

Your effort is highly appreciated!!

Edited by notview
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...