OMG. Thanks. That was the problem.
So, the company I work for has been worked mainly with MX Road for a long time, and there is a lisp that created the layouts and viewports from modelspace polyline frames based on the Modelspace page setup. But it has some limitations.
We don’t use sheet creation for profile views as we don’t really like C3D alignment viewframes for workflow reasons and AFAIK sheets can’t be created for profile views without those.
So, I try to mimic said lisp and spice it up a bit with previously made Dynamo stuff.
Shame on me that with my 10 years of xp with Acad I did not notice there are setups for Modelspace and Paperspace
I’ll see if I can add some better documentation to the nodes to make it more clear what they are doing, and maybe surface a better error message instead of just returning null.
Hi Zachri,
I was wondering if there is a node that allows Civil3D to also close ExternalDocuments that have been opened by the ExternalDocument.LoadFromFile node.
In my script I work with batches of dwg-files in their respective directory and to keep my computer from running out of memory I run my script after copying just 1 directory in the “main” directory. To go to the next directory I have to delete the old ones from the “main” directory but I can’t because they’re still opened by Civil3D.
To work around this I now simply close and reopen Civil3D altogether, but that takes a bit of time every iteration.
I experimented with this when I was developing those nodes. I don’t think there is a way to explicitly “close” with any type of API call. Under the hood, those nodes are just opening up a side database for the DWG and then keeping the instance of the object alive so you can use it with downstream nodes. In a typical use case (i.e. not Dynamo), you would just dispose of the object, at which point the editing lock would be released. That’s basically what I did with the nodes by implementing the IDisposable interface, so when you unplug the input port for ExternalDocument.LoadFromFile, then the underlying object is disposed/released. At least that’s the theory
However, in my tests this does not happen instantaneously. It takes some time (around 5-10 seconds is what I saw) for everything to get cleaned up and the DWG to be released. So if your script has a bunch of operations strung together without any delay between batches, then it probably won’t work. I think you’ll have to incorporate some type of delay into your script between batches, or create something that looks for the presence of the .dwl files and pauses execution until those are all cleaned up.
I see, thanks for the quick response.
The idea is to run the entire script from the Dynamo Player without having to open Dynamo itself.
I’ll just restart Civil3D then for every batch, no problem!
OK got it. It’s something I would love to revisit and see if we could come up with a solution, but the honest truth is that I don’t have time right now, and probably won’t in the amount of time it takes you to just close/reopen Civil 3D
Does it work if you close/reopen Player?
No, I have to restart Civil3D aswel
This might get what you’re after:
https://help.autodesk.com/view/OARX/2021/ENU/?guid=OARX-ManagedRefGuide-Autodesk_AutoCAD_ApplicationServices_DocumentExtension_CloseAndSave_this_Document_string
Thanks, Jacob. A document is a different thing, so unfortunately that method isn’t applicable here.
Hello everyone,
would there be in the near future a Externalobject.dimension ? that would be cool.
Dear @zachri.jensen
You may have missed my previous post, but could you please comment on the node ExternalDocument.LoadFromFile?
https://forum.dynamobim.com/t/camber-feedback-thread/68942/362?u=ana.ortizmpu5k
@ana.ortizMPU5K - I would recommend to just construct the full path to the Xref. You should be able to do this with the information provided in the Document.Detail node.
I can add it to the list, but there is no timeline for completion.
Indeed, your “Document.Detail” node approach would be a solution if the xref files are in the same folder as the base file. But when the xrefs are in other directories (for example, to get to the xref you have to go up two folders higher and go down 3 levels to another folder), the task becomes tricky.
So it seemed much more user-friendly to me to just read this property in C3D (since it’s already in program memory as I’ve shown in the screenshot in the last post).
It isn’t quite that simple, but I can add it to the to-do list for when I have some free time to make updates.
As you know @zachri.jensen your contribution to the community is fantastic
Wonder, do you have any possibility to add a node to add station equation for alignments? That one from Civil 3D Toolkit only get the output about the information about the station equation but when I create object that should use the station equation as input or as a property it’s not give the correct result.
I know that you are busy but maybe you can put it in your backlog.
Kind regards,
Patrick
Hi @zachri.jensen, is it possible with Camber to add sample section sources from TIN surfaces to section views? Is it posible to project objects (cogo points) to multiple section views? I don’t know how to continue with my graph.
Hi @zachri.jensen - It looks like the CodeSetStyle.RemoveItem node only works with point codes. The following error is thrown when attempting to remove a shape or link code
If it’s not a issue within the nodes, please create a new thread because it gives a lot of value to seperate those from the Feedback thread and it makes it easier to give you help.