ah, thanks. I have considered the locking of layers in other portions of
the code. I was thninking that might be the case. Thanks
Jamie
"Joe Burke" wrote in message
news:6015888@discussion.autodesk.com...
Jamie,
Sorry about the delayed reply.
The code I posted is "dangerous" in the sense if anything goes wrong while
copying
and erasing objects within block definitions, you might end up with corrupt
or
incomplete blocks. For instance, there is no error checking for locked
layers.
Joe Burke
"The Dark Princess" wrote in message
news:6012462@discussion.autodesk.com...
I have tested the code and it does exactly as you described, my fault for
not understanding it at first.
I only need to tweak the if statement...
Again, if you please, what does the 'dangerous bit' refer to?
Jamie
"Joe Burke" wrote in message
news:6012106@discussion.autodesk.com...
Jamie,
Again you fail to reply to the question asked. "Post an example file which
demonstrates the code I posted does not work." Whether it is dangerous or
not has
nothing to do with the validity of the code.
Joe
"Princess Jamie" wrote in message
news:6011157@discussion.autodesk.com...
perhaps you can explain the bit dangerous part.
Jamie
"Joe Burke" wrote in message
news:6011028@discussion.autodesk.com...
Post an example file which demonstrates the code I posted does not work.
Joe
"The Dark Princess" wrote in message
news:6010317@discussion.autodesk.com...
Thank you for your input.
This does nothing in addressing the problem, namely revising the handles of
objects within blocks so that these objects will be visually above the other
objects, but it teaches me more about vlisp which is great.
Jamie
"Joe Burke" wrote in message
news:6004006@discussion.autodesk.com...
Jamie,
Something like this for the blocks. Test it on copies of working files. It
is a
bit dangerous.
Joe
[code]
;; Hatch to back in blocks example.
;; Minimal error checking.
(defun c:H2B ( / doc blocks copylst)
(setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
(setq blocks (vla-get-blocks doc))
(vlax-for x blocks
(if
(and
(zerop (vlax-get x 'IsXref))
(not (eq "*MODEL_SPACE" (strcase (vlax-get x 'Name))))
(not (eq "*PAPER_SPACE" (strcase (vlax-get x 'Name))))
)
(vlax-for i x
(if (not (eq "AcDbHatch" (vlax-get i 'ObjectName)))
(setq copylst (cons i copylst))
)
)
)
(if copylst
(progn
(vlax-invoke doc 'CopyObjects (reverse copylst) x)
(mapcar 'vla-delete copylst)
)
)
(setq copylst nil)
)
(vla-regen doc acActiveViewport)
(princ)
) ;end
[/code]
"The Dark Princess" wrote in message
news:6003242@discussion.autodesk.com...
sorry Joe! sorry sorry - here, have a timbit...:-)
on the bottom please
so I need to copy the entites in the block other than hatches and entities
on hatch layers....
got it
not sure how to do that while stepping through the block's objects
Jamie