marmo Posted October 1, 2010 Posted October 1, 2010 Hi,:shock: PROBLEM: I usually use comand section or section plane to have 2d drawing from 3d model. I konw that yuo can generate 2d section block with command sectionplane, but all entities are placed on layer 0. With command section output regions are placed on current layer. IDEA: Is possible create a lisp based on command SECTON (no SECTIONPLANE) to have regions on same layer of different sectioned SOLIDS. So you might study a 3D object composed of different layers and have 2D sections organized into seme different layer, according to a criterion more complex (for example, organized according to different materials). REQUEST: Someone has this lisp? Or is there someone who can develop it? Thank you all for this great site!!!! Marco Quote
jammie Posted October 1, 2010 Posted October 1, 2010 Hey Marco It should be possible to achieve this with a lisp routine. Basically you will need to create a selection set of the 3dsolids and pick 3points that provide the section boundary. Iterate through the selectionset. A solid object has a vla-SectionSolid method that can produce a region, based on the pick points, which you can change the layer to match the source object Do you have any code written yourself that you could post? Regards Jammie Quote
marmo Posted October 1, 2010 Author Posted October 1, 2010 Hi, jammie! I do not know the language lisp... I'm studying but now i am only able to write macro commands... Quote
jammie Posted October 1, 2010 Posted October 1, 2010 Well as a starting point this may be of use. It has not been heavily tested. Also it doesn't take into account layers which may be locked (defun c:foo (/ tempSelectionSet pt1 pt2 pt3 i sourceObject sourceLayer acdbMarker) (if (and (setq tempSelectionSet (ssget (list (cons 0 "3dSolid")))) (setq pt1 (getpoint "\nSpecify first point on Section plane:")) (setq pt2 (getpoint pt1 "\nSpecify second point on plane: ")) (setq pt3 (getpoint pt1 "\nSpecify third point on plane:")) ) (progn (setq i 0) (repeat (sslength tempSelectionSet) (setq sourceObject (vlax-ename->vla-object (ssname tempSelectionSet i))) (setq acdbMarker (entlast) sourceLayer (vla-get-layer sourceObject) i (1+ i)) (vla-SectionSolid sourceObject (vlax-3d-point pt1) (vlax-3d-point pt2) (vlax-3d-point pt3) ) (while (setq acdbMarker (entnext acdbMarker)) (vla-put-layer (vlax-ename->vla-object acdbMarker) sourceLayer) ))))) Quote
marmo Posted October 2, 2010 Author Posted October 2, 2010 Hi Jammie! Lisp is perfect!!! Is simple, fast and opeative. Works with complex models! Thank you very much! Regards Marco Quote
jammie Posted October 5, 2010 Posted October 5, 2010 Hi Jammie! Lisp is perfect!!! Is simple, fast and opeative. Works with complex models! Thank you very much! Regards Marco Glad to help Marmo! I don't work with solids very often so it was a good learning curve for me as well Regards Jammie Quote
Recommended Posts
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.