Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

API for PointLabelStyle

10 REPLIES 10
Reply
Message 1 of 11
Anonymous
510 Views, 10 Replies

API for PointLabelStyle

Hi,

As there appears to be no API for Point label style how do you code to allow
the user to select a point label style from a list box and then create a
point using that style?

As an alternative (since I know how I want the label to appear), can I
create a label style with code and assign that to the point I create.

The points hold program assigned descriptions, which cannot readily be
allowed for with a Description Key set.

--

Regards,


Laurie Comerford
www.cadapps.com.au
10 REPLIES 10
Message 2 of 11
Anonymous
in reply to: Anonymous

Hi,

I spoke too early. I seem to be able to populate the list box with:

Dim oStyle as Object

For Each oStyle in g_oAeccDoc.PointLabelStyles
Listbox.AddItem oStyle.Name

etc


and the following code works:

oPoint.LabelSyle = g_oAeccDoc.PointLabelStyles.Item(Listbox.Value)


Laurie

"Laurie Comerford" wrote in message
news:5255742@discussion.autodesk.com...
Hi,

As there appears to be no API for Point label style how do you code to allow
the user to select a point label style from a list box and then create a
point using that style?

As an alternative (since I know how I want the label to appear), can I
create a label style with code and assign that to the point I create.

The points hold program assigned descriptions, which cannot readily be
allowed for with a Description Key set.

--

Regards,


Laurie Comerford
www.cadapps.com.au
Message 3 of 11
nzeeben
in reply to: Anonymous

I am not doing much other than looking but does
collection.points.item(x).labelstyle not get you what you need? You will
have to assign the style after you create the point, but it seems to me it
is there? Maybe I missed the point entirely.

Nick
"Laurie Comerford" wrote in message
news:5255742@discussion.autodesk.com...
Hi,

As there appears to be no API for Point label style how do you code to allow
the user to select a point label style from a list box and then create a
point using that style?

As an alternative (since I know how I want the label to appear), can I
create a label style with code and assign that to the point I create.

The points hold program assigned descriptions, which cannot readily be
allowed for with a Description Key set.

--

Regards,


Laurie Comerford
www.cadapps.com.au
Message 4 of 11
Anonymous
in reply to: Anonymous

Hi Nick,

Thanks for the response. As you can see from my second post, you are right.

The mistake I made was not to look under the Document Object for the Point
Label Styles.

--

Laurie Comerford
CADApps
www.cadapps.com.au
wrote in message news:5255738@discussion.autodesk.com...
I am not doing much other than looking but does
collection.points.item(x).labelstyle not get you what you need? You will
have to assign the style after you create the point, but it seems to me it
is there? Maybe I missed the point entirely.

Nick
"Laurie Comerford" wrote in message
news:5255742@discussion.autodesk.com...
Hi,

As there appears to be no API for Point label style how do you code to allow
the user to select a point label style from a list box and then create a
point using that style?

As an alternative (since I know how I want the label to appear), can I
create a label style with code and assign that to the point I create.

The points hold program assigned descriptions, which cannot readily be
allowed for with a Description Key set.

--

Regards,


Laurie Comerford
www.cadapps.com.au
Message 5 of 11
Anonymous
in reply to: Anonymous

Thanks much for posting your solution, Laurie.

"Laurie Comerford" wrote in message
news:5255757@discussion.autodesk.com...
Hi,

I spoke too early. I seem to be able to populate the list box with:

Dim oStyle as Object

For Each oStyle in g_oAeccDoc.PointLabelStyles
Listbox.AddItem oStyle.Name
etc
and the following code works:

oPoint.LabelSyle = g_oAeccDoc.PointLabelStyles.Item(Listbox.Value)
Message 6 of 11
nzeeben
in reply to: Anonymous

The documentation is so wonderful for the api.
"Laurie Comerford" wrote in message
news:5255929@discussion.autodesk.com...
Hi Nick,

Thanks for the response. As you can see from my second post, you are right.

The mistake I made was not to look under the Document Object for the Point
Label Styles.

--

Laurie Comerford
CADApps
www.cadapps.com.au
wrote in message news:5255738@discussion.autodesk.com...
I am not doing much other than looking but does
collection.points.item(x).labelstyle not get you what you need? You will
have to assign the style after you create the point, but it seems to me it
is there? Maybe I missed the point entirely.

Nick
"Laurie Comerford" wrote in message
news:5255742@discussion.autodesk.com...
Hi,

As there appears to be no API for Point label style how do you code to allow
the user to select a point label style from a list box and then create a
point using that style?

As an alternative (since I know how I want the label to appear), can I
create a label style with code and assign that to the point I create.

The points hold program assigned descriptions, which cannot readily be
allowed for with a Description Key set.

--

Regards,


Laurie Comerford
www.cadapps.com.au
Message 7 of 11
Sinc
in reply to: Anonymous

I can't get this to work.

When I access the AeccDoc.PointLableStyles collection, all it has in it is the top-level styles. All children are missing.

How do I get a complete list of Point Label Styles, including all children?

(using .NET)
Sinc
Message 8 of 11
Anonymous
in reply to: Anonymous

The LabelStyle Object has a Children property:

Children Gets the collection of all label styles derived directly or indirectly from this label style.


wrote in message news:5790225@discussion.autodesk.com...
I can't get this to work.

When I access the AeccDoc.PointLableStyles collection, all it has in it is the top-level styles. All children are
missing.

How do I get a complete list of Point Label Styles, including all children?

(using .NET)
Message 9 of 11
Anonymous
in reply to: Anonymous

This subject came up a few weeks back at a
customer meeting.

Their in-house C3D programmer that uses the
supporting code and libraries I build for them,
told me there was a bug in my code. 😮

He was passing it the objects in the collection
returned by the PointLabelStyle's, 'Children'
property, but did not see all of the derived
styles displayed in the UI.

As it turns out, the PointLabelStyle's 'Children'
property doesn't do what its description says
it does.

The 'Descendents' and 'Children' properties have
their descriptions reversed. Children contains only
directly-derived styles. Descendents contains both
directly- and indirectly-derived styles, as the name
implies.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Jeff Mishler" wrote in message news:5790349@discussion.autodesk.com...
The LabelStyle Object has a Children property:

Children Gets the collection of all label styles derived directly or indirectly from this label style.


wrote in message news:5790225@discussion.autodesk.com...
I can't get this to work.

When I access the AeccDoc.PointLableStyles collection, all it has in it is the top-level styles. All children are
missing.

How do I get a complete list of Point Label Styles, including all children?

(using .NET)
Message 10 of 11
Sinc
in reply to: Anonymous

OK, I am now able to get the list of styles.

However, if I try to change the current PointLabelStyle programmatically, I can only get it to work if I set it to a top-level style. Otherwise, I get an exception thrown on an "invalid parameter".

Is there some trick to setting the current PointLabelStyle to a style that is not a top-level style?
Sinc
Message 11 of 11
Anonymous
in reply to: Anonymous

Given the documentation bug, it's possible that the
programmer that wrote that is incorrectly testing the
value you pass in for membership in the Children
collection rather than the Descendents collection.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5796326@discussion.autodesk.com...
OK, I am now able to get the list of styles.

However, if I try to change the current PointLabelStyle programmatically, I can only get it to work if I set it to a top-level style. Otherwise, I get an exception thrown on an "invalid parameter".

Is there some trick to setting the current PointLabelStyle to a style that is not a top-level style?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report