AddWithLeader Sketched symbol

AddWithLeader Sketched symbol

Anonymous
Not applicable
609 Views
8 Replies
Message 1 of 9

AddWithLeader Sketched symbol

Anonymous
Not applicable
Inventor 2009, I tried to run the sketched symbol AddWithLeader method
example, and I get a invalid procedure call error on the last line.
Everything I look at seems to be OK. It has a reference to the active
sheet, there is a sketched symbol for it to use, oLeaderPoints contains 2 2d
points and a geometry intent object.

Any idea why it might be failing?

--
KWiKMcad
Kent Keller
0 Likes
610 Views
8 Replies
Replies (8)
Message 2 of 9

Anonymous
Not applicable
I tried the sample and it works for me. I suspect the problem could be with
the GeoemtryIntent. Are you selecting a linear drawing curve before running
the code? If that's not the problem, could you post a file that shows the
issue?

Sanjay-
0 Likes
Message 3 of 9

Anonymous
Not applicable
Thanks Sanjay

Your response made me do some more testing and my first sketched symbol has
some prompted entry's. It appears if I use a sketched symbol without a
prompted entry it works.

--
KWiKMcad
Kent Keller
"Sanjay Ramaswamy (Autodesk)" wrote in
message news:6161287@discussion.autodesk.com...
I tried the sample and it works for me. I suspect the problem could be with
the GeoemtryIntent. Are you selecting a linear drawing curve before running
the code? If that's not the problem, could you post a file that shows the
issue?

Sanjay-
0 Likes
Message 4 of 9

Anonymous
Not applicable
Ah, I see. If there are prompted entries, you'll also need to provide the
"PromptStrings" argument of the AddWithLeader method.

Sanjay-
0 Likes
Message 5 of 9

Anonymous
Not applicable
Sanjay,

One more question on this example. If I follow the Intent, it should start
the leader at the midpoint of the selected line, but it always starts it at
the end of the selected line. How do you get it to start at the midpoint?

--
KWiKMcad
Kent Keller
"Sanjay Ramaswamy (Autodesk)" wrote in
message news:6161394@discussion.autodesk.com...
Ah, I see. If there are prompted entries, you'll also need to provide the
"PromptStrings" argument of the AddWithLeader method.

Sanjay-
0 Likes
Message 6 of 9

Anonymous
Not applicable
Kent,

The sample uses the curve midpoint only to calculate leader points, but
doesn't attach the leader to the midpoint. In order to do so, you need to
specify a mid-point intent when creating the GeoemtryIntent object. Just
replace the GeometryIntent creation line in the sample with the following:

Set oGeometryIntent = oActiveSheet.CreateGeometryIntent(oDrawingCurve,
kMidPointIntent)

Sanjay-
0 Likes
Message 7 of 9

miechh
Collaborator
Collaborator
> {quote:title=Sanjay wrote:}{quote}
> Ah, I see. If there are prompted entries, you'll also need to provide the
> "PromptStrings" argument of the AddWithLeader method.
>
> Sanjay-

Hello Sanjay,

The help in Inventor doesn't tell me how to use the "PromptStrings" argument, is it possible for you to tell me how this argument should be passed? Thanks in advance!

Product Design Suite 2024
Inventor 2024 (v 28.20.27200.0000), Vault Basic 2024
Fusion 360
HP Workstation Z4
Intel Xeon 3.4GHz
32GB RAM
Windows 10 Professional (64bit)
0 Likes
Message 8 of 9

Anonymous
Not applicable
I got this from another part of the API (AddUsingSheetFormat method), but I'm guessing that it is pretty close to the same.






"Optional input array of Strings that specifies the input strings to use as input for prompted text fields that my be present in the title block definition referenced by the sheet format. The prompt strings and their order are obtained by querying the TextBox objects in the TitleBlockDefinition. The order they're returned by the TextBoxes collection is the same order the input strings need to be supplied in the TitleBlockPromptStrings array."

0 Likes
Message 9 of 9

miechh
Collaborator
Collaborator
Thanks Josh,

I just found out that the PromptStrings argument should be an array of strings alone. In the help is written that the PromptStrings argument must be a Variant, but this is not true. When I used the Variant type, an error is raised. After I set my PromptString object to the String-type, all went OK.

Product Design Suite 2024
Inventor 2024 (v 28.20.27200.0000), Vault Basic 2024
Fusion 360
HP Workstation Z4
Intel Xeon 3.4GHz
32GB RAM
Windows 10 Professional (64bit)
0 Likes