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: 

Set point group label style to "none"

18 REPLIES 18
Reply
Message 1 of 19
c__h
2062 Views, 18 Replies

Set point group label style to "none"

This is probably really simple, but I cannot seem to set a point label style to "none" for a point group (using VB.net)

Does anybody know how I can do this?

Also, on a side note, when I run my code, and shutdown Civil 3d after, I get a Fatal Error saying "Attempt to access AecUiBaseServices after shutdown!"

Any idea why?

Thanks Message was edited by: honeyman
18 REPLIES 18
Message 2 of 19
Anonymous
in reply to: c__h

For the Error (Internal, not Fatal) see the thread by that name started by Tony Tanzillo on Aug. 14, 2007. You will need
to convert the code Tony posted from C# to VB, but there's not much to it.


wrote in message news:5811848@discussion.autodesk.com...
This is probably really simple, but I cannot seem to set a point label style to "none" for a point group (using VB.net)

Does anybody know how I can do this?

Also, on a side note, when I run my code, and shutdown Civil 3d after, I get a Fatal Error saying "Attempt to access
AecUiBaseServices after shutdown!"

Any idea why?

Thanks

Message was edited by: honeyman
Message 3 of 19
Anonymous
in reply to: c__h

Can you not simply make a label style that is empty and call it "none"? Then apply that label style to the point group. Or am I not understanding the question fully?

Jeremy
C3D 2008
Message 4 of 19
c__h
in reply to: c__h

Yes, I could. I was just hoping to avoid making a style throught the API if there was a simple way to set it to none. I would think that none would also be a bit more efficient, but mabe there is no difference.

And thanks Jeff for helping me sovle that other problem. That worked.
Message 5 of 19
Sinc
in reply to: c__h

I don't suppose anyone has found a way around this issue? I was trying to do the same thing in .NET, and cannot do it there, either.

I, too, do not want to create a "default empty style" via the API. I simply want to be able to set the Point Style or Point Label Style to "None".

I had some thoughts of trying to use PInvoke to try to get around this issue, but I'm not even sure what DLL to look in, and was not able to locate any promising entry points.

Note: this problem still exists in the 2009 API.

And there is something wrong with the PointStyle and PointLabelStyle properties on the AeccCogoPoint and AeccPointGroup entities - they cannot be used via .NET. Instead, the compiler tells us to use the undocumented get_PointStyle(), set_PointStyle(), get_PointLabelStyle(), and set_PointLabelStyle() methods. These methods work, but they throw exceptions when trying to set the style to "None" (I have tried passing empty strings, nulls, etc., with no luck).
Sinc
Message 6 of 19
nzeeben
in reply to: c__h

I dont have an install handy to look into setting these to none. I can comment on your second point about get and set. This is a quirk in the way C# handles overloaded inputs. The reason set and get show up are because on the COM side we allow you to pass either the Style object you wish to use or just s string containing the styles name. As it turns out C# does not like this overloading and the compiler forces the get and set methods to be used.

Nick
Message 7 of 19
Sinc
in reply to: c__h

Thanks, that makes some sort of sense.
Sinc
Message 8 of 19
Sinc
in reply to: c__h

Hey Nick, did you ever find out anything about setting these styles to "-None-"?
Sinc
Message 9 of 19
Sinc
in reply to: c__h

Hey Nick, did you ever find out anything about this?
Sinc
Message 10 of 19
bruce.jordan
in reply to: c__h

I thought I would bring this back to life since I am having a similar issue with point styles, similar to the posted issue of point groups.
I am using c3d 2009, v4, w/ VBA. I have not tried 2010 yet.

I can change a point's style to any style that exists, but cannot set it to an empty value so point groups control the style.
In short I am trying to set a point's style to "", which really is not a style. I've tried "", "", and Nothing, but just cannot change the style to be controlled by point group. The same problem exists with a point's label style.

So just checking back to see if anyone found a solution.

-Bruce
Message 11 of 19
Anonymous
in reply to: c__h

I too am having this problem (and i'm using C3D 2010). Surely there must be a way to set a point's style to . Even creating a style that has no display isn't a real option for me as i want the points style to be set by the active point group.

-Mark P.
Message 12 of 19
Anonymous
in reply to: c__h

I'm not sure I understand but I'll take a stab at it.

Are you not getting what you want when 'OVERRIDING' the styles in
the point group definition ?


"brjordan" wrote in message news:6244739@discussion.autodesk.com...
I thought I would bring this back to life since I am having a similar issue
with point styles, similar to the posted issue of point groups.
I am using c3d 2009, v4, w/ VBA. I have not tried 2010 yet.

I can change a point's style to any style that exists, but cannot set it to
an empty value so point groups control the style.
In short I am trying to set a point's style to "", which really is not
a style. I've tried "", "", and Nothing, but just cannot change the
style to be controlled by point group. The same problem exists with a
point's label style.

So just checking back to see if anyone found a solution.

-Bruce
Message 13 of 19
Anonymous
in reply to: c__h

Overriding the style is not the issue. The issue is programmatically setting the style to "none".

-Mark P.
Message 14 of 19
bruce.jordan
in reply to: c__h

I noticed my original post lost some formatting, so hopefully it made since.
I want to avoid using overrides.

In the attached png - I want to clear out any styles in the style column (so it's empty).
So the point style you manually select to do this is "none", but that is not a style, so you cannot assign your point style name to "none".

-Bruce
Message 15 of 19
stacy.dunn
in reply to: c__h

If it is the point itself you can in VBA:

Dim variable as a variant
set variable as Null
oPoint.Style.Name = variable

that will put it back to the value

Let me know if that is what you are looking for or if it helps.

Stacy Edited by: stacy.dunn on Aug 27, 2009 9:58 PM
Stacy Dunn
Message 16 of 19
bruce.jordan
in reply to: c__h

Yep, once I saw null in your post I kind of figured that was what I was looking for.
Worked like a charm.

Thanks

-Bruce
Message 17 of 19
stacy.dunn
in reply to: c__h

Im glad that worked. How do you access an individual point group to make a change to it?
Stacy Dunn
Message 18 of 19
Anonymous
in reply to: c__h

Hmnnnnn, that doesn't work for me in .NET, any ideas?

my code:

{code}
Public Sub teststyle()
Dim dm As DocumentCollection = Application.DocumentManager
Dim doc As Document = dm.MdiActiveDocument

Dim aeccApp As New AeccApplication
aeccApp.Init(Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication)

Dim comCivilDoc As AeccDocument = aeccApp.ActiveDocument

Dim nostyle As VariantType = VariantType.Null
comCivilDoc.Settings.PointSettings.StyleSettings.Style.Value = nostyle

End Sub
{code}
Message 19 of 19
bruce.jordan
in reply to: c__h

I will usually populate a list box or combo box with point groups and then have something similar to the following

Dim oPtGroups As AeccPointGroups
Dim oPtGroup As AeccPointGroup
Set oPtGroups = g_oDocument.PointGroups
Set oPtGroup = oPtGroups.Item(cmbPointGroups.Text) 'highlighted point group from combo box
oPtGroup.PointStyle = "Standard"
oPtGroup.PointLabelStyle.Name = "Standard"

I tried the Null variable similar to the single point you pointed out, but am having troubles getting that to work. So the example above has the styles hardcoded.

-Bruce

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report