Jump to content

HELP command SECTION: REGIONS on LAYERS by sectioned SOLID


Recommended Posts

Posted

Hi,:shock::shock:

 

PROBLEM::glare:

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:icon3.gif

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::P

Someone has this lisp? Or is there someone who can develop it?

 

Thank you all for this great site!!!!icon7.gif

 

Marco

Posted

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

Posted

Hi, jammie!:shock:

 

I do not know the language lisp... I'm studying but now i am only able to write macro commands...

Posted

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)
     )))))

Posted

Hi Jammie! :D

 

Lisp is perfect!!!

Is simple, fast and opeative.

Works with complex models!

Thank you very much!

Regards

Marco

Posted
Hi Jammie! :D

 

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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...