Author Topic: Change SectionPlane Thickness and enable live section- from lisp  (Read 991 times)

0 Members and 1 Guest are viewing this topic.

nekonihonjin

  • Newt
  • Posts: 103
Change SectionPlane Thickness and enable live section- from lisp
« on: September 05, 2022, 08:14:19 PM »
What's up guys
I borrowed some codes and put them together, to get a section view with the help of a sectionplane, I can't find a way to indicate that the plane has Live Section enabled, without having to do it manually.
It is a Slice type plane, and it is created with a predetermined width, I would like it to be a very thin width, in the order of 0.01, I could not find any option that allows me to modify this value within a lisp.


Code: [Select]
  (setq pt1 (vlax-curve-getendpoint obj))
  (setq pt2 (vlax-curve-getstartpoint obj))
  (setq v1 '(0 0 1));Plane Vector - (0 0 1) is straight up
  (setq *acad* (vlax-get-acad-object));Get the ACAD object
  (setq *ad* (vlax-get-property *acad* 'ActiveDocument));Get the Active Document
  (setq *ms* (vlax-get-property *ad* 'ModelSpace));Get the Model Space
  (setq section-object (vlax-invoke-method *ms* 'AddSection (vlax-3d-point pt1)(vlax-3d-point pt2)(vlax-3d-point v1)))

(vla-put-State2 section-object acSectionState2Slice)
  (setq settings (vla-get-Settings section-object))
  (vla-put-CurrentSectionType settings acSectionTypeLiveSection) ;SectionType
  (setq sec-type-sett (vla-GetSectionTypeSettings
                        settings
                        acSectionTypeLiveSection))
(vla-put-IntersectionFillVisible sec-type-sett :vlax-false)

(vla-put-LiveSectionEnabled sec-type-sett :vlax-true) ; <= this doesn't work (or exist)






**Edit: I was trying too hard to use vla to turn on section view, it turns out is as simple as this:
Code: [Select]
(setq section (entlast))
(command "_livesection" section)

Now it's just the slice thinckness problem.

« Last Edit: September 05, 2022, 08:56:27 PM by nekonihonjin »