0

I am creating a gradient inside of a LWPolyLine with the code

(progn
    (setq hatch (vla-addHatch mspace 
                              acPreDefinedGradient
                              "LINEAR"
                              :vlax-true
                              acGradientObject)
    )
    (vlax-put hatch 'PatternAngle (/ pi 2))
    (vlax-invoke hatch 'AppendOuterLoop (list pline))
    (vla-evaluate hatch)
)

The problem occurs when trying to set the PatternAngle. I get the error:

Error: AutoCAD.Application: Not applicable

Without that line, it works fine. The gradient is just rotated by 90 degrees.

What am I doing wrong? I have a feeling it has something to do with the acPreDefinedGradient. Like I shouldn't be using a predefined gradient. Possibly using acUserDefinedGradient.

4

1 回答 1

1

好像我应该使用GradientAngle,而不是PatternAngle

(progn
    (setq hatch (vla-addHatch mspace 
                              acPreDefinedGradient
                              "LINEAR"
                              :vlax-true
                              acGradientObject)
    )
    (vlax-put hatch 'GradientAngle (/ pi 2))
    (vlax-invoke hatch 'AppendOuterLoop (list pline))
    (vla-evaluate hatch)
)

Sheesh,我希望有关于这些事情的适当文档。

于 2013-07-08T23:43:19.530 回答