Author Topic: BricsCAD Civil Test drawing  (Read 415 times)

0 Members and 1 Guest are viewing this topic.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8661
  • AKA Daniel
BricsCAD Civil Test drawing
« on: March 06, 2024, 10:54:23 PM »
Anyone have a BricsCAD Civil drawing I can use for python unit testing? It should be something that can be shared as I intend
To post it in test media https://github.com/CEXT-Dan/PyRx/tree/main/unit%20tests/testmedia

Preferably a big fat meaty drawing  that will give me good test coverage  :laugh:

PrinceLISPalot

  • Newt
  • Posts: 34
  • perfectionist trapped inside the mind of an idiot.
Re: BricsCAD Civil Test drawing
« Reply #1 on: March 07, 2024, 08:05:57 PM »
What type of data are you looking for?

New Zealand has lots of free source data that you could use to create a Civil model from
https://www.linz.govt.nz/products-services/data/types-linz-data/elevation-data
http://data.linz.govt.nz/

https://portal.opentopography.org/datasets?loc=New%20Zealand
https://koordinates.com/


It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8661
  • AKA Daniel
Re: BricsCAD Civil Test drawing
« Reply #2 on: March 08, 2024, 02:07:11 AM »
Thanks for the links!

I’m working on python wrappers for the object enablers for BricsCAD civil, so I’m hoping to find a .DWG file to where I can scan the drawing and make sure I can read / write the properties. I.e. for Tins, Alignments

So far I can create objects, but  :crazy2:…..  I’d rather be testing on something that’s more accurate

Code - Python: [Select]
  1. class TestBCadCivil(unittest.TestCase):
  2.     def __init__(self, *args, **kwargs):
  3.         super(TestBCadCivil, self).__init__(*args, **kwargs)
  4.         self.BCADCIVIL1 = Db.Database(False, True)
  5.         self.BCADCIVIL1.readDwgFile("./testmedia/BCADCIVIL1.dwg")
  6.         self.BCADCIVIL1.closeInput(True)
  7.  
  8.     def __del__(self):
  9.         del(self.BCADCIVIL1)
  10.  
  11.     def test_BsysCvDbAlignment_dxfName(self):
  12.         objHnd = Db.Handle("AE")
  13.         objId = self.BCADCIVIL1.getObjectId(False, objHnd)
  14.         self.assertEqual(objId.isValid(), True)
  15.         dbo = Db.Entity(objId)
  16.         self.assertEqual(dbo.isA().dxfName(), "BsysCvDbAlignment")
  17.        
  18.     def test_BsysCvDbAlignment_obj(self):
  19.         objHnd = Db.Handle("AE")
  20.         objId = self.BCADCIVIL1.getObjectId(False, objHnd)
  21.         self.assertEqual(objId.isValid(), True)
  22.         hAlignment = Cv.CvDbHAlignment(objId)
  23.         self.assertFalse(hAlignment.isNullObj())
  24.         self.assertEqual(hAlignment.elementCount() ,3)
  25.