Jump to content

Lisp routine to add hatch geometry to properties from unbounded hatch


Recommended Posts

Posted

I have a civil3d (2025) file where parcels of different types are hachured using parameters within the parcel styles

image.png.9e6bc4964a5140d1e26c80b83bc1a354.png

 

 When I export the civil3d file to either a dfx or dwg the generated hatch is not bounded and as such the area and accumulated area values are missing from the hatch properties.  This is information is needed by others who do not use civil3d.

image.png.1d5b4ee38c0f13b8658499c6e42bf394.png

 

Is there a way to add this information to the hatch when exporting the file or once it has been exported without having to recreate the hatch either by lisp or otherwise 

Posted (edited)

Hi @andyb57J
I think you haven't received any further answers so far because we're not sure we understand you.
In principle, I believe that any drawing edited in Civil 3D and opened in a standard version of AutoCAD should contain the same information for a 'hatch' object
To check if this is the case, do the following:
-In Civil 3D, type '(entget (car (entsel)))' in the command line, press ENTER, and then select one of those hatches. Save the information returned by AutoCAD.
-Start the standard version of AutoCAD, open the same drawing, type the same code above in the command line, and press ENTER.

The result should be exactly the same in both cases.

If not, send us a screenshot of both results.

Edited by GLAVCVS
Posted (edited)

 

 

The parcel is hatchured from the Style Dropdown.

image.thumb.png.10410ded259ae580add64be73415ec2a.png

 

From the Civil3d files

image.thumb.png.9b8068b936881f39df0c8b7677b711eb.png

 

image.png.c5c03db725becfd89da711a28475cacc.png

From the Autocad file after exporting via ExportC3ddrawing command

image.thumb.png.1d0eb472bf8722d9a7586f763cb4a6c0.png

 

image.png.7cf6341aa763cbae5f15cce798bcd926.png

 

Hope this helps.  Dwg files attached.

 

At present out workaround is to copy the hatch areas to a new drawing then create new hatch boundaries.  Then delete the existing hatch and then hatch the remaining hatch boundaries to get the area and accumulated areas geometry information into properties.   Although this is easy enough given that each lot type is on its own layer it would be great if we could get that information when it is converted from a civil3d drawing to an Autocad drawing.

 

Drawing10.dwgFetching info... ACAD-Drawing10-Model.dwgFetching info...

Edited by andyb57J
Posted

Maybe all you need is creation of associative hatch boundary...

If you have newer versions of AutoCAD, there is command HATCHGENERATEBOUNDARY...

If you don't have newer versions of AutoCAD, you can try to generate boundary through HATCHEDIT command and use button called Recreate hatch boundary...

Posted

It seems that the object in Civil 3D isn't exactly a standard hatch. When opened with a standard version of AutoCAD, it "translates" it into a standard hatch.
Because of this, the original object's properties are lost.
I think this can only be remedied with some code.
And you'd have to consider whether to do it from Civil 3D or in standard AutoCAD.

Anyway, wait a bit: someone might know a better solution.

Posted

I am happy if its done in Autocad as that is generally what most users use and I think would be easier. 

 

Even a lisp routine that allows you to globally select the "HATCH" in the AutoCAD drawing and then generates the boundary around each piece of hatch. Then asks the user to select the existing hatch and sets the layer as current before deleting all "HATCH" and the looping through creating the new hatch based on the layer style.

 

I hope this makes sense.  Generally automate what I already do in the form of a lisp. 

Posted
  On 3/24/2025 at 11:07 AM, marko_ribar said:

Maybe all you need is creation of associative hatch boundary...

If you have newer versions of AutoCAD, there is command HATCHGENERATEBOUNDARY...

If you don't have newer versions of AutoCAD, you can try to generate boundary through HATCHEDIT command and use button called Recreate hatch boundary...

Expand  

I use the HATCHGENERATEBOUNDARY command

Posted
  On 3/24/2025 at 12:11 PM, andyb57J said:

I am happy if its done in Autocad as that is generally what most users use and I think would be easier. 

 

Even a lisp routine that allows you to globally select the "HATCH" in the AutoCAD drawing and then generates the boundary around each piece of hatch. Then asks the user to select the existing hatch and sets the layer as current before deleting all "HATCH" and the looping through creating the new hatch based on the layer style.

 

I hope this makes sense.  Generally automate what I already do in the form of a lisp. 

Expand  

Just an idea: you could write a lisp that would associate the information you need with the object and another lisp for the standard versions of AutoCAD that would be loaded and executed at the start of each drawing (from "acad####.lsp", for example), that would check if there is any hatch object with associated information and that would carry out, if necessary, the appropriate tasks.

Posted

A big answer Drawing10 it is not a hatch its a AECC_PARCEL. My Bricscad identifies it as that. EntityName (RO) = "AeccDbFace"

 

The ACAD....10 reveals proxy objects but in Bricscad its area is 18920.779, checked with lisp code can get Area. 

 

You need to maybe get the "Proxy object enabler" for Autocad maybe that will allow area. 

Posted
  On 3/24/2025 at 10:22 PM, BIGAL said:

A big answer Drawing10 it is not a hatch its a AECC_PARCEL. My Bricscad identifies it as that. EntityName (RO) = "AeccDbFace"

 

The ACAD....10 reveals proxy objects but in Bricscad its area is 18920.779, checked with lisp code can get Area. 

 

You need to maybe get the "Proxy object enabler" for Autocad maybe that will allow area. 

Expand  

Unfortunately this doesnt work either. 

Posted

When you click on the Acad...10 dwg what does property return as an object ? Bricscad its hatch. copy this to command line (entget (car (entsel "\nPick object"))) 

 

I get Pick object((-1 . <Entity name: 405fe300>) (0 . "HATCH")

Posted
  On 3/25/2025 at 11:48 PM, BIGAL said:

When you click on the Acad...10 dwg what does property return as an object ? Bricscad its hatch. copy this to command line (entget (car (entsel "\nPick object"))) 

 

I get Pick object((-1 . <Entity name: 405fe300>) (0 . "HATCH")

Expand  

 

image.thumb.png.3408a96004ae60fb533dd9dcbd3a54df.png

 

This was done previously and results are as previous entry.  Autocad shows it as a hatch but there is no area or geometry associated with it.  

As per GLAVCVS Civil 3d does not identify it as a hatch - It is a fill and does not have any geometry associated with it.  

 

image.png

Posted (edited)

I don't have Civil3D at the moment, so I can't verify this.
But it seems that the "AECC_PARCEL" object must be a container object for other objects, the main one of which should be a hatch.
Perhaps someone with Civil3D can confirm this.

Edited by GLAVCVS

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...