iam using below mentioned code for divide option.but iam getting the point style only. I need to place "selected block" instead of point style.
(defun c:div ()
(setq val (getint " no of POINTS"))
(setq val (* 2 val))
(command "divide" pause val)
(setq ss (ssget "p"))
(setq co 1)
(setq len (sslength ss))
(repeat len
(setq en (ssname ss co))
(setq det (entget en))
(entdel en)
(setq co (+ co 2))
)
)
Solved! Go to Solution.
Solved by Kent1Cooper. Go to Solution.
@shefipmoosa wrote:iam using below mentioned code for divide option.but iam getting the point style only. I need to place "selected block" instead of point style.
(defun c:div ()
(setq val (getint " no of POINTS"))
(setq val (* 2 val))
(command "divide" pause val)
(setq ss (ssget "p"))
(setq co 1)
(setq len (sslength ss))
(repeat len
(setq en (ssname ss co))
(setq det (entget en))
(entdel en)
(setq co (+ co 2))
)
)
You are not telling it to divide with a block
replace
(command "divide" pause val)
with
(command "divide" pause "_B" "xxx" ("_Y" or "_N") val)
replace "xxx" with the name of the block you want to divide the line with
delete "_Y" or "_N" depending on whether you want to align the blocks "_Y" or not "_N"
I'm not sure what the rest of you code is trying to do
I am not one of the robots you're looking for
autocad divide option are different,This code iam using for placing no.of lights.( if 3 lights lighting placement methord is starting point point to x, next two point are 2x ,and 3rd to end x ) this code already customized as per this requirement. but I gave number of point its coming to point style, I need to add selected block / block name instead of point style.
@shefipmoosa wrote:
.... if 3 lights lighting placement methord is starting point point to x, next two point are 2x ,and 3rd to end x .....
You can use the DIV+ command in DivideMeasurePlus.lsp, available >here<. One of its many enhancements over ordinary DIVIDE is that it has an option to place the markers [with Blocks as one of the options] at the midpoints of the divided segments, rather than at the dividing points. You would use the Block option and use that midpoints option with 3 as the number of divisions.
Sounds like a custom divide take length divide by a spacing, then start 1st block at a distance from start end is same distance. Plenty of code examples provide the required spacing.
@Sea-Haven wrote:
... take length divide by a spacing, then start 1st block at a distance from start end is same distance. ....
If I understood the OP's description correctly, this is what they're really looking for:
DIV+ will do that. Here's the command sequence that did the above [dark blue are typed-in entries]:
Command: DIV+
Divide with Points/Blocks/Lines/Selection ? <P>: S
For Selection set with which to Divide,
Select objects: {select the Circle, which can be anywhere} 1 found
Select objects: {Enter to complete selection}
Base point in relation to Selection: CEN of {pick on the Circle to get its center}
Selection rotation, or Aligned with path or Relative angle to path [angle/A/R] <A>: {enter to accept default -- doesn't matter in this case}
Enter number of Segments, or M for Maximum spacing <M>: 3
Place Selection at division points (Standard) or at Midpoints of divisions [S/M]? <S>: M
Select object to Divide: {select the Line}
Select object to Divide: {enter to end command}
... and note that in line with the original request, DIV+ offers a Blocks option, also, and if that is chosen, the rotation [which doesn't matter for a Circle] has several options [more than regular Divide offers].
Your right just need the poster now to respond its nice to know if it matched their needs.
Can't find what you're looking for? Ask the community or share your knowledge.