Recent Posts

Pages: 1 2 3 [4] 5 6 ... 10
31
.NET / How to create Link between objects?
« Last post by Augusto on June 01, 2023, 10:18:08 PM »
Hello, everyone!

I decided to step out of my comfort zone and put autoLisp aside for a while. This is my first code in C# for AutoCAD.

The goal of this code is to initially create a representation of a flexible tube. I would really like to link the block I'm creating with the polyline and, depending on the event, recreate the block while maintaining its initial creation characteristics.

Unfortunately, after many attempts, I couldn't store the block information within the polyline. In the commented sections of the code, I can create a dictionary and assign it to the polyline, but after the modification (stretch), the dictionary disappears, and I can't access it to obtain the ObjectId of the block and then perform the deletion.

Since I don't have previous experience with the API, I imagine my code is not very good, and I'm also not following any best practices in AutoCAD .NET development, which results in duplicated code and other oddities. In the future, I will strive to produce something better, but for now, I'm just trying to learn and make it work.

I would greatly appreciate it if you could assist me with object linking and perhaps provide tips on best practices in AutoCAD .NET development.

I'm using autoCAD 2020 and visual studio 2019.

I've been looking at some code on the through-the-interface page. This would be the best scenario, where the links are maintained and loaded when loading the drawing, but I think I'm not ready to implement something of such complexity yet.

https://through-the-interface.typepad.com/through_the_interface/2006/11/linking_circles_1.html

I haven't worked with the collisions and other things that must be done yet, so the code produces bad results on very steep curves. I intend to put the minimum bend radius based on the diameter and material properties.

The project is attached, as well as the dwg file in 2010 format.

Thanks in advance for any help.

Best regards, Luís Augusto.
32
Get a copy of TriangV0.5.9.lsp by YMG it will make triangular surfaces. Plus other stuff.

Thinking more if you were to convert a surface to a solid you could draw a 3d path and add a road shape along the path so have 2 solids, subtract road and you have what your looking for. the road shape could have batter slopes need to make sure are wide enough for the subtraction, this is what the "merge surfaces" does in the civil software.

Also look at Civil Site Design.
33
CAD General / Re: Stretch outside visible area depends on visual style
« Last post by ribarm on June 01, 2023, 01:20:35 PM »
I can't say that your *.gif explains all that I suppose was thinking (gif is cut out, so complete viewing area is not presented)... I remember that when A2018 new features came, one of the first things was selecting on double monitors, or single one where you start selecting in one portion, then pan and continue, first viewing is off screen and you still in selection mode... When finished, it was gripped/highlighted all when zoomed out... I suppose the same thing is with stretching, just never tested, so that I could state - bug... Bug was with vla-add3dmesh - @Dominicomaria presented when attempted to create BOX... Bug is when I tested (vlax-curve-getpointatdist) providing distance greater then complete length of curve - ACAD throwed start point instead of nil... Bug is when you set QAFLAGS sys/env variable to 1 and ACAD start to behave strange with commands LAYER,..., so I always say reset it as soon as possible to 0... There is also ACAD 2015 VVC error, when using command functions inside (mapcar '(lambda ( x ) ...) lst), or using command instead command-s in error handler... And also memory problems when ACAD crashes - without any reason, or with something not explainable...
34
Land Lubber / Geographically Positioned / Re: Simplify a C3D DEM surface?
« Last post by wizman on June 01, 2023, 12:47:53 PM »
Convert the surface to DEM and use the Map tools in Civil 3D.  It might give better analysis and representation.

Edit:
I missed that it was originally from a DEM which can be used directly into Map.  Another idea, you can have overlapping two copies of the same surface.  Each having different styles.  One is showing the contours and the other surface contains only the shaded steep slopes from slope analysis.
35
CAD General / Re: Stretch outside visible area depends on visual style
« Last post by dexus on June 01, 2023, 08:49:44 AM »
Hey ribarm, thanks for your answer.

Who says I'm not going to extrude the 2D entities into solids and therefore working in conceptual.

Depends on how it is solved, if its by changing the visual style or zooming to the object before stretching, probably yes.
But this seems like a bug or hopefully a setting and it would be great if there is a less clunky way of solving it.

I'm using AutoCAD 2015, so it seems like it was sort of introduced before that only when using the 2D Wireframe Visual Style...
36
Land Lubber / Geographically Positioned / Re: Simplify a C3D DEM surface?
« Last post by CHulse on June 01, 2023, 08:45:24 AM »
Thanks - Good thought, but I don't think so.
Per the help: "When you plot a drawing, the full detail of all objects will be included, even if level of detail mode is on."
37
Land Lubber / Geographically Positioned / Re: Simplify a C3D DEM surface?
« Last post by wizman on June 01, 2023, 08:38:01 AM »
Does turning on the level of detail help?
38
Land Lubber / Geographically Positioned / Simplify a C3D DEM surface?
« Last post by CHulse on June 01, 2023, 08:16:51 AM »
I have a surface in C3D created from a 1m DEM. It's very dense. I only need it for some visual topo and steep slope analysis (not for a design, just an FYI on the plan) so it doesn't need to be so detailed. The slope visualization is terrible as it is. Anyone have thoughts on a best method to reduce/simplify the surface to get the topo and steep slopes to display more smooth/simply?
Thanks
39
CAD General / Re: Stretch outside visible area depends on visual style
« Last post by ribarm on June 01, 2023, 05:47:48 AM »
First, off topic :
Why do you have to use "Conceptual" Visual Style when working with 2D entities?
Second :
You have above 100 posts - I suppose you are capable to write such small routine that can overcome this issue...

FYI : Stretching and performing operations out of viewing area was introduced with AutoCAD 2018, so still, if and only if you wrote something, you'll have to have A2018 or above 2019, 2020, 2021, 2022, 2023, 2024...
40
CAD General / Stretch outside visible area depends on visual style
« Last post by dexus on June 01, 2023, 03:40:58 AM »
Hi everyone,

The stretch function is giving me problems when I change the Visual Style of the drawing.
When the selection is off screen, no stretch is preformed at all.
But when I change the visuals style to 2D Wireframe, everything works as expected.
Below a demonstration of the problem.

Is there a way to fix this? Or maybe an autolisp solution to circumvent this (for me) unexpected behavior?

Thanks!
Pages: 1 2 3 [4] 5 6 ... 10