View Full Version : Recovery of layers after solprof
Lutirat
21st Jun 2007, 08:35 pm
Hello everybody!
I have a problem as follows: I create a lot of solids on many different layers. Very often I use solprof to get 2D views of my models. But after using solprof, all generated 2D objects are on the same layer (PV-xxxx) :cry: . Then I have to restore layers manually. Is there a way (please say there is!!!) to do it automaticly?
I use AutoCAD 2006.
SLW210
21st Jun 2007, 09:01 pm
Are you just doing a part on one layer in SOLPROF? When you do a SOLPROF AutoCAD makes new layers for the objects you pick. Usually you will get a PH-xxxx (Hidden) and a PV-xxxx (Visible). To freeze the rest of the layers in the viewport, double-click in the viewport and in the Layer Manager select those 2 layers while holding the CTRL key to highlight both of them, right-click on one of the layers and select 'Invert Selection', under Current VP Freeze double-click on one of the icons to freeze the rest of the layers in that viewport. That's how I do it, there may be a quicker way in some of the newer versions.
Lutirat
21st Jun 2007, 09:21 pm
Maybe I was not very precise:
I have a lot of solids that partially obscure one another. I can't make SOLPROF for each separate solid because then I wouln't have HIDE effect.
What I need is to have 2D objects on the same layers that the solids they were generated from.
SLW210
21st Jun 2007, 09:34 pm
Maybe I was not very precise:
I have a lot of solids that partially obscure one another. I can't make SOLPROF for each separate solid because then I wouln't have HIDE effect.
What I need is to have 2D objects on the same layers that the solids they were generated from.
You need to use the flatten command to create your 2D views.
It would be hard to automatically do it, because as far as I can tell there is no certain way to tell what the layer names would be, as AutoCAD seems to select random numbers.
You could try SOLVIEW and SOLDRAW, but they create their own layers as well, but could be easier to rename.
LSR
21st Jun 2007, 09:48 pm
There is no automatic way of doing it; you have to do it manually.
Try something different other than SOLPROF, you could try using the DXB virtual printer to create 2D drawings out of 3D models. And you can open it using your own pre-made template drawing.
Lutirat
21st Jun 2007, 10:08 pm
Wow, FLATTEN is ALMOST exactly what I need. It does the job with the layers but the views it generates are very poor... At least for round and small solids. I get some unrecognizable objects instead of circles (generated from cylinders) or side views of screws, ect.
SOLVIEW+SOLDRAW works in the same manner as SOLPROF - good view but all visible objects on the same layer...
But thaks for the answers anyway.
DXB virtual printer? OK, I'll try to learn to use it.
SLW210
21st Jun 2007, 10:11 pm
Wow, FLATTEN is ALMOST exactly what I need. It does the job with the layers but the views it generates are very poor... At least for round and small solids. I get some unrecognizable objects instead of circles (generated from cylinders) or side views of screws, ect.
SOLVIEW+SOLDRAW works in the same manner as SOLPROF - good view but all visible objects on the same layer...
But thaks for the answers anyway.
There are some lisps around called flat and zero and a few others. that do the similar thing and might be better.
SLW210
21st Jun 2007, 10:16 pm
Try this one:
(defun c:flat (/ total-nabor)
(vl-load-com)
(if
(setq total-nabor (ssget "x" '((410 . "model"))))
(progn
(setq total-nabor
(mapcar 'vlax-ename->vla-object
(mapcar 'cadr
(ssnamex total-nabor)))
)
(foreach i '(1e99 -1e99)
(mapcar (function (lambda (x)
(vla-move x
(vlax-3d-point (list 0 0 0))
(vlax-3d-point (list 0 0 i)))
)) total-nabor )))
)
(princ)
)
Lutirat
21st Jun 2007, 10:29 pm
And you can open it using your own pre-made template drawing.
Could you please clarify this? How do I open a file using a template drawing? How should I made this template?
SLW210
21st Jun 2007, 10:31 pm
Could you please clarify this? How do I open a file using a template drawing? How should I made this template?
Here is a tutorial on it.
http://www.caddigest.com/subjects/AutoCAD/tutorials/select/042804_parsai_dxb_files.htm
Lutirat
21st Jun 2007, 10:34 pm
Try this one:
(defun c:flat (/ total-nabor)
(vl-load-com)
(if
(setq total-nabor (ssget "x" '((410 . "model"))))
(progn
(setq total-nabor
(mapcar 'vlax-ename->vla-object
(mapcar 'cadr
(ssnamex total-nabor)))
)
(foreach i '(1e99 -1e99)
(mapcar (function (lambda (x)
(vla-move x
(vlax-3d-point (list 0 0 0))
(vlax-3d-point (list 0 0 i)))
)) total-nabor )))
)
(princ)
)
Hmmm, I'll try as soon as I learn how lisps work :) .
SLW210
21st Jun 2007, 10:36 pm
Check this out.
http://www.cadtutor.net/forum/showthread.php?t=1390
Powered by vBulletin™ Version 4.0.6 Copyright © 2010 vBulletin Solutions, Inc. All rights reserved.