I currently use a tool called Steamroller.lsp
I have editited it once to have it ask you before running the operation.
So right now you run the tool
You get a prompt to run the tool
It grabs all the Survey Figure Lines, explodes them
Figures become 3D polylines
3D polylines are flattened and become 2D polylines
My surveyor would love it if the tool had one more step, so it would run like this:
You get a prompt to run the tool
It grabs all the Survey Figure Lines, explodes them
Figures become 3D polylines
**A copy is made of all 3D polylines and moved to LAYER-XXXXX**
3D polylines (the once not copied to new layer) are flattened and become 2D polylines
Is this possible? In the realm of a non programmer to do or will I probably be hiring this out?
Solved! Go to Solution.
Solved by hmsilva. Go to Solution.
One way,
change
(if (setq C3DOBJ (ssget "X" '((0 . "POLYLINE*")))) (command "AeccConvert3dPolys" C3DOBJ "") )
to
(if (setq C3DOBJ (ssget "X" '((0 . "POLYLINE*")))) (progn (vl-load-com) (if (not (tblsearch "LAYER" "LAYER-XXXXX"));; change the LayerName (command "_.layer" "_N" "LAYER-XXXXX" "");; change the LayerName ) (repeat (setq i (sslength C3DOBJ)) (setq obj (setq VlaObj (vlax-ename->vla-object (ssname C3DOBJ (setq i (1- i)))))) (setq new (vla-copy obj)) (vla-put-Layer new "LAYER-XXXXX");; change the LayerName ) (command "AeccConvert3dPolys" C3DOBJ "") ) )
Hope that helps
Henrique
Works great! Thank You! I think I can fumble through the code at this point and have it create the LAYER-XXXX if that layer is not present in the drawing. If that layer is not present I get an error, it it is present then it works great.
@claimed4all wrote:
Works great! Thank You! I think I can fumble through the code at this point and have it create the LAYER-XXXX if that layer is not present in the drawing. If that layer is not present I get an error, it it is present then it works great.
You're welcome, claimed4all.
It should not giva an error if layer don't exist...
See if the layer name is correctly written in all places that has changed
Henrique
Hmm... Back to the drawing board.
I added just the lines you said, left the LAYER-XXXX and the tool seems to skip copying over the 3D polylines to that layer. I will look at the code more in depth and see if I can my error. Still breaks them to 2D polylines, just skips the step and does not create the LAYER-XXXX.
Thanks again for the help.
@claimed4all wrote:
Hmm... Back to the drawing board.
I added just the lines you said, left the LAYER-XXXX and the tool seems to skip copying over the 3D polylines to that layer. I will look at the code more in depth and see if I can my error. Still breaks them to 2D polylines, just skips the step and does not create the LAYER-XXXX.
Attach the modified code, if possible.
EDIT: try the attached code, if don't run as expected, in a new dwg copy/paste to the commandline
(command "_.layer" "_N" "LAYER-XXXXX" "")
what is the return, did the "LAYER-XXXXX" was created?
Henrique
I see that. I tried to remove it but I get an error. Like I said, I mostly fumble through these codes. How would I correct this issue? I attached the updated code on my previous post.
Sorry, my bad!
Try the revised code...
Henrique
Interesting. Works as orginally. Tool dumbs everything down to a 2D polyline. The tool is skipping the step of putting a copy of of the 3D polylines on layer LAYER-XXXXX
@claimed4all wrote:
Interesting. Works as orginally. Tool dumbs everything down to a 2D polyline. The tool is skipping the step of putting a copy of of the 3D polylines on layer LAYER-XXXXX
Is the layer LAYER-XXXXX created?
Henrique
I'm not a C3D guy, but the code should work as expected...
Delete the layer and copy/paste to the command line
(not (tblsearch "LAYER" "LAYER-XXXXX"))
what is the return?
Henrique
@claimed4all wrote:
The return is T
T is the expected return...
The code should work as expected...
In a new dwg, draw some 3dpolylines, load this code snippet, and type demo.
(defun c:demo ( / C3DOBJ I NEW OBJ) (if (setq C3DOBJ (ssget "X" '((0 . "POLYLINE*")))) (progn (vl-load-com) (if (not (tblsearch "LAYER" "LAYER-XXXXX")) (command "_.layer" "_N" "LAYER-XXXXX" "") ) (repeat (setq i (sslength C3DOBJ)) (setq obj (vlax-ename->vla-object (ssname C3DOBJ (setq i (1- i))))) (setq new (vla-copy obj)) (vla-put-Layer new "LAYER-XXXXX") ) (command "AeccConvert3dPolys" C3DOBJ "") ) ) (princ) )
Henrique
That code right there worked as inteded. It copied my 3D polylines to layer LAYER-XXXXX and then it took the original 3D polylines and turned them into basic polylines.