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: 

Add Label Set to new Profile in Profile View

9 REPLIES 9
Reply
Message 1 of 10
Sinc
382 Views, 9 Replies

Add Label Set to new Profile in Profile View

Is it possible to add a label set (grade break, vertical curve, etc.) to a new Profile in a Profile View via the API?
Sinc
9 REPLIES 9
Message 2 of 10
Civil3DReminders_com
in reply to: Sinc

The program does add a label set automatically, I just can't figure out where it pulls it from. I couldn't get the sample profile vba code to have the labels show up without going in and adjusting the station range to get them to show up.

If you started with the NCS template I think if you change the _NoLabels to have labels and run your code, you should see that the labels from that label set are added.

Christopher
http://civil-3d.blogspot.com/
Civil Reminders
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Alumni
Message 3 of 10
Sinc
in reply to: Sinc

No, I am not using the NCS template.

The template I use should be irrelevant. If it's possible to add profile labels, then it should be possible to do it regardless of what template is used to create the drawing.

I have not been able to get any profile labels to appear when I create a new Profile, and I cannot find anyplace in the 2008 API where this property is accessed. I see the Style Label Sets themselves, just no way to apply them to a Profile.

I have not checked the 2009 API yet to see if I can find access there.
Sinc
Message 4 of 10
Civil3DReminders_com
in reply to: Sinc

I don't think you can select the label set through the API, the program uses the default labels set (I'm not sure how/where the program chooses it) but it would be dependent on the template you are using. I know it should be irrelevant, but it appears it is.

To try this out open the sample profile vba code, run it on the acad.dwt template. The label set won't show up in the drawing, but if you Edit Labels you will see that the standard label set are in the list. A bug to be sure, since they should show up on the profile.

Christopher
http://civil-3d.blogspot.com/
Civil Reminders
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Alumni
Message 5 of 10
Sinc
in reply to: Sinc

OK, I think you gave me enough to figure it out. Sure enough, it doesn't really have anything to do with the template, unless you count the fact that the labels that get used are the defaults, as set in the drawing settings.

As far as the API, my random pokings seem to indicate that the Profile must be created before the Profile View. Then, when the Profile View is created, the labels automatically go on the Profile - possibly only if the profile.ShowLabels == TRUE.

From all I've been able to determine, there is no way to get labels on a Profile via the API after the Profile View is created.
Sinc
Message 6 of 10
Sinc
in reply to: Sinc

I may have spoke too soon.

It's looking like I get labels on profiles if I create the Profile View last, but the labels all seem to be the Standard label set. The test drawing I was using just happened to have a Standard set that looked like the set I thought I was using, and I didn't notice the issue at first.

So far, I have not been able to find any way to get anything but the Standard label set on there.
Sinc
Message 7 of 10
Civil3DReminders_com
in reply to: Sinc

This is more of a question then a useful answer. Couldn't you load the Civil 3D program files that handle the adding the label sets and use the objects from them to add the labels? I'm way over my head in this question, but you can use a program that comes with ObjectARX download to snoop in the drawing and it shows the commands and objects that the program uses. I have the cheapo VS express, and I don't know C++, so I haven't been able to try it.

Again I have no idea of what I am talking about.
Civil Reminders
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Alumni
Message 8 of 10
Sinc
in reply to: Sinc

Not sure if there's anything there that will help or not. It's definitely turned something very simple into a huge hassle, maybe not even worth pursuing.

I looked at the 2009 API, and it looks the same there.

So unless this feature is just hidden in some really, really obtuse place in the API, I don't think it's possible.
Sinc
Message 9 of 10
Sinc
in reply to: Sinc

Digging into it some more, I noticed that many of the default templates do not have a Standard label set for Profiles.

So then I discovered I can delete and rename Label Sets at will, and C3D will not auto-create another Standard set. For us, this means this becomes a non-issue, because so far we've only really found the need for a single Label Set. And if there's only one Label Set in the drawing, it gets used automatically. So all we need to do is delete the Standard Label Set from all our drawings and templates, and we get the behavior we want.

But if we regularly used multiple label sets, this would be more of an issue. I tried deleting and creating Label Sets, and I could find no obvious rule for which set got applied. I thought it might be something simple, like the earliest-created set would be the one used, or the latest-created set, but neither seems to be the case. Then I thought maybe alphabetical, but that doesn't seem to be the case either. So far, it just seems completely random to me as to which set ends up being used. But whatever set it uses, it uses that same one consistently. Deleting or creating Label Sets can sometimes get it to start using a different one, but then it keeps using that same one until you create or delete label sets again.
Sinc
Message 10 of 10
Sinc
in reply to: Sinc

I'm looking through the 2009 API, and as far as I can tell, there is still no way to control the Label Sets that get applied to Profile Views.

Is this correct? Or have I just not found it yet?
Sinc

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report