AddSolid Method

Creates a 2D solid polygon.

Signature

VBA : RetVal = object.AddSolid(Point1, Point2, Point3, Point4)

VL : RetVal = (vla-AddSolid Point1 Point2 Point3 Point4)

(vla-AddSolid mspace 
                   (vlax-3d-point PT1) 
                      (vlax-3d-point PT2)
                      (vlax-3d-point PT3) 
                            (vlax-3d-point PT4))

  • Object : ModelSpace Collection, PaperSpace Collection, Block
    The object or objects this method applies to.

  • Point1 : Variant (three-element array of doubles); input-only

  • Point2 : Variant (three-element array of doubles); input-only

  • Point3 : Variant (three-element array of doubles); input-only

  • Point4 : Variant (three-element array of doubles); input-only

  • RetVal : Solid object
    The newly created polygon.

Remarks

The first two points define one edge of the polygon. The third point is defined diagonally opposite from the second. If the fourth point is set equal to the third point, then a filled triangle is created.

Solids are filled only when the FILLMODE system variable is set to on. To set or query a system variable, use the SetVariable and GetVariable methods, respectively.

Example :


(defun c:al-addSolid ()

(vl-load-com)

(setq mspace (vla-get-modelspace 
                 (vla-get-activedocument 
                     (vlax-get-acad-object))))

(setq PT1 (getpoint "\nFirst Point: "))

(setq PT2 (getpoint PT1 "\nSecond Point: "))

(setq PT3 (getpoint PT2 "\nThird Point: "))

(setq PT4 (getpoint PT3 "\nFourth Point: "))

(setq theSolid (vla-AddSolid mspace 
                   (vlax-3d-point PT1) 
                      (vlax-3d-point PT2)
                         (vlax-3d-point PT3) 
                            (vlax-3d-point PT4)))

(princ)

);defun