Can you please suggest a way out on this error.
This error is occurring for a daylight at a particular profile at station zero. What will be the probable solution hints by looking at the error messages. @hippe013
Please suggest.
Solved! Go to Solution.
Solved by hippe013. Go to Solution.
You can use the debugger within Visual Studio to view your subassembly's code as it is being applied to a corridor.
Is this your own subassembly that you are writing or one of the stock subassemblies provided in the example code (C3DStockSubassemblies)?
In the Utilities class of the C3DStockSubassemblies solution the is a shared/static sub/void RecordError, are you utilizing that? If so, that might be a good spot to set a break point for when you debug your code.
Another suggestion... Post Your Code!
Without seeing your code, it is only a guess as to what might be causing the error. I'd like to help but, but I need to see the code in order to do so.
How familiar are you with Visual Studio? Have you debugged with AutoCAD before? The reason I ask is that my response below assumes some familiarity with debugging AutoCAD code with Visual Studio.
Debugging for a subassembly code is similar to debugging any other solution for AutoCAD (Civil 3D).
After building your solution you start your debugging session how you normally would, but with a subassembly you will want to reload the subassembly into your drawing and apply it to your corridor prior to rebuilding your corridor. Rebuilding your corridor with the subassembly applied will then run through the code you wrote for the subassembly.
Make sure that the subassembly that you have created is pointing to your .NET Assembly (DLL) file.
The above image shows a stock assembly and the path to the DLL that it is pointing to. Your subassembly should be pathed to your own DLL file.
In order to this you will need to have an understanding of writing code for subassemblies (See example code in the supplied C3DStockSubassemblies Solution). You will need to have an understanding of creating .PKT files with all of the necessary files required in the .PKT file, as well as, have an understanding of loading and unloading subassemblies from the Subassemblies Tool Palette.
Debugging subassemblies gave me a much more in-depth understanding of how subassemblies work. It's worth the effort to learn how.
This makes sense. I didn't think of compiling the dll to the imported tools folder nor that I could debug that way because of the whole pkt thing. I usually leave myself "debugging messages" through the editor containing calculated values which is painstakingly slow and frustrating at times. Thank you for the idea I'll give it a try, and apologies for hijacking the thread with my follow-up question.
edit: I got it working. This will save me so much time in the future. thanks for the tip @hippe013 !
"An applied assembly is an instance of an assembly template attached to a specific station along a corridor."
It doesn't seem to make sense to access the applied assemblies during the build process of the corridor. They are the computed assemblies that are attached as a result of the build.
I use the applied assembly collection to get the individual sections of an existing corridor. You can think of the applied assemblies as the RESULT of the corridor build, so trying to access them during the build doesn't make sense.
For example: You have a subassembly representing a 12-foot-wide lane. In your corridor you add a widening target featureline that stretches the lane from 12 feet to 24 feet and your corridor inserts sections along the way that stretch from 12 to 24 feet. You would use the applied assemblies you access those sections. I hope that I am clarifying this enough and not making it more confusing.
If you could show a little more of your code, or at least explain in detail what you are trying to achieve, I think we can get to a solution.
Yes I commented the code of applies subassemblies, it is giving me the desired output.
Thank you for the help.
If any testing errors come , will get back on this.
Thank you.
Can't find what you're looking for? Ask the community or share your knowledge.