Jump to content

Find the object!


Recommended Posts

Traffic Management.dwg

 

Hi all,

 

Attached is a dwg file with a layers, WALL_RIGHT and KERB_TOP (at least I hope the file is attached)

 

Can you delete layer WALL_RIGHT? Via the Purge command. I have used the Laydel comman previously but this doesnt seem to delete the object.

 

The object is a square with two lines predruding it. The data is being put into a GIS System and it picks up the 'invisible' object (Even after Laydel has been used in the .dwg file)

 

But I cant find the object anywhere! There are no blocks in the drawing...

 

Can anyone figure out where the object is? If so please detail how you found it!

 

Thanks muchly

Link to comment
Share on other sites

The line on that layer doesn't display as it is custom linetype 14 (whatever you have that setup as) from Civilcad. Civilcad linetypes are a right pain and I would always convert them to the native AutoCad linetypes (i.e. 'Continious' instead of 'solid' etc). Are you using the latest version of Civilcad (7.something)?

 

Freeze layers 0 and the kerb layer and then Ctrl -A to sleet the invisible line and change its linetype to something else (Continuous say) and then you will be able to delete it and purge the drawing and the WALL_RIGHT layer will be deleted as it is now empty.

Link to comment
Share on other sites

Ok heres the help you want its in VBA because that was the flavour when I wrote it, a bit of insider info Civilcad uses a 3rd party engine for the writing of DWG files, I dont know why though they decided to have a SHX link probably because it was easier. I will check verison 7.0 and see if it still has the translation table option ccad line = Autocad line.

 

Basicly you need to convert all objects to Bylayer then you can remove the ccad linetype definitions and replace with ACAD ones. see Solid linetype stuff below

 

We had a DOT linetype at the start some drawings would take 10 mins to open lots of tiny dots we got our surveyors to not use it sounds like your Linetype 14 may be similar.

 

For those reading Civilcads linetypes just blow away Autocad so easy to make just draw it and turn it into a linetype.

 

The code is part of a bigger module so I have just cut and pasted the relevant bits.

 

So load in VBAMAN and run ccad6layerfix you will need to edit the linetype names etc to suit

 

Hope this helps post reply if not and I will help further

 

Public Sub DelPointCross()
Dim SS As AcadSelectionSet
Dim objENT As AcadBlockReference
Dim Count As Integer
Dim val As String
On Error Resume Next
Set SS = ThisDrawing.SelectionSets.Add("MYSS")
SS.Select acSelectionSetAll
For Each objENT In SS
objENT.color = acByLayer
objENT.Linetype = "ByLayer"
Next objENT
ThisDrawing.SendCommand "regen" & vbCr
'MsgBox "There are " & SS.count & " entities in the Selection Set", vbInformation
val = "POINT_CROSS" 'CivilCAD 5.7
For i = 0 To SS.Count
Set objENT = SS(i)
   If objENT.Name = val Then
   objENT.Delete
   Else: End If
Next i
val = "CCAD_POINT_CROSS" 'CivilCAD 6
For i = 0 To SS.Count
Set objENT = SS(i)
   If objENT.Name = val Then
   objENT.Delete
   'objENT.Update
   Else: End If
Next i
'SS.Select acSelectionSetAll
ThisDrawing.SelectionSets.Item("MYSS").Delete
ThisDrawing.SetVariable "PDMODE", 1
ThisDrawing.Regen acActiveViewport

End Sub
Sub ccad6layerfixup()
Dim objENT As AcadEntity
Dim ssetObj As AcadSelectionSet
Dim layercode As String
Dim objLayers As AcadLayers
Dim objLayer As AcadLayer
Dim X, Y, J, k As Integer
Dim lname, ans, ltype As String
Dim MyLAYERNAME(256) As String
Dim MyLAYERCOLOR(256) As Integer
Dim MyLAYERLINETYPE(256) As String
'On Error GoTo filediafix
' 256 max LINES 3 VARIABLES
Open "S:\Autodesk\lisp\civilcad6layercodes.txt" For Input As #1
' setvar filedia to 0
ThisDrawing.SendCommand "filedia" & vbCr & "0" & vbCr
'loads all custom linetypes purges first then reloads
'ThisDrawing.SendCommand "-purge" & vbCr & "lt" & vbCr & "*" & vbCr & "N" & vbCr
'ThisDrawing.Linetypes.Load "FENCE", "s:\autodesk\supportfiles\custom.lin"
'ThisDrawing.Linetypes.Load "TREE", "s:\autodesk\supportfiles\custom.lin"
'ThisDrawing.Linetypes.Load "WATER_MAIN", "s:\autodesk\supportfiles\custom.lin"
'ThisDrawing.Linetypes.Load "GAS_MAIN", "s:\autodesk\supportfiles\custom.lin"
'ThisDrawing.Linetypes.Load "SEWER_MAIN", "s:\autodesk\supportfiles\custom.lin"
'ThisDrawing.Linetypes.Load "BATTER", "s:\autodesk\supportfiles\custom.lin"
'ThisDrawing.Linetypes.Load "DASHED2", "s:\autodesk\supportfiles\ACAD.lin"
'ThisDrawing.Linetypes.Load "BATTERUP", "s:\autodesk\supportfiles\custom.lin"
'ThisDrawing.Linetypes.Load "DASHED", "s:\autodesk\supportfiles\ACAD.lin"
'ThisDrawing.Linetypes.Load "CENTER", "s:\autodesk\supportfiles\ACAD.lin"
ThisDrawing.Linetypes.Load "FENCE", "custom.lin"
ThisDrawing.Linetypes.Load "TREE", "custom.lin"
ThisDrawing.Linetypes.Load "WATER_MAIN", "custom.lin"
ThisDrawing.Linetypes.Load "GAS_MAIN", "custom.lin"
ThisDrawing.Linetypes.Load "SEWER_MAIN", "custom.lin"
ThisDrawing.Linetypes.Load "BATTER", "custom.lin"
ThisDrawing.Linetypes.Load "DASHED2", "ACAD.lin"
ThisDrawing.Linetypes.Load "BATTERUP", "custom.lin"
ThisDrawing.Linetypes.Load "DASHED", "ACAD.lin"
ThisDrawing.Linetypes.Load "CENTER", "ACAD.lin"
' reset all solid linetypes to continuous
Set objLayers = ThisDrawing.Layers
For Each objLayer In objLayers
 If objLayer.Linetype = "solid" Or objLayer.Linetype = "SOLID" Then
 objLayer.Linetype = "Continuous"
 End If
Next objLayer
MsgBox "Solid Linetypes reset in the layers"
For Each objLayer In objLayers
'If objLayer.Name = "FENCE" Then
 
 'If objLayer.Linetype = "903" Then
' objLayer.Linetype = "FENCE"
' End If
Next objLayer
MsgBox "903 Linetypes reset in the layers"
For Each objLayer In objLayers
 If objLayer.Linetype = "dash" Then
 objLayer.Linetype = "DASHED"
 End If
Next objLayer
MsgBox "DASH Linetypes reset in the layers"

For Each objLayer In objLayers
 If objLayer.Linetype = "VEGETATION" Then
 objLayer.Linetype = "TREE"
 End If
Next objLayer
MsgBox "Vegetation Linetypes reset in the layers"
' now change layer colors and linEtype for all entities to bylayer
Set ssetObj = ThisDrawing.SelectionSets.Add("MYsSS")
ssetObj.Select acSelectionSetAll
For Each objENT In ssetObj
objENT.color = acByLayer
objENT.Linetype = "ByLayer"
Next objENT
ThisDrawing.SelectionSets.Item("MYsSS").Delete
'read in each line of data file with layer name colour and linetype
Y = 0
Do While Not EOF(1)    ' Check for end of file.
 Line Input #1, layercode    ' Read line of data.
  ' MsgBox "1   lines" & layercode
   
  ans = Mid(layercode, 1, 22)    'LAYER NAME
  J = 22
  lname = ""
  For k = 1 To J
  character = Mid(ans, k, 1)
  If character = " " Then k = J Else lname = lname + character
  Next k
  MyLAYERNAME(Y) = lname
  
  MyLAYERCOLOR(Y) = CInt(Mid(layercode, 23, 1))    'COLOR NUMBER
  
  ans = Mid(layercode, 25, 10)
  
  J = 10
  ltype = ""
  For k = 1 To J
  character = Mid(ans, k, 1)
  If character = " " Then k = J Else ltype = ltype + character
  Next k
  MyLAYERLINETYPE(Y) = ltype    ' LINETYPE
  
   
   Y = Y + 1
Loop
Close #1    ' Close file.

For Each objLayer In objLayers
 For X = 1 To Y
 If objLayer.Name = MyLAYERNAME(X) Then
 objLayer.color = MyLAYERCOLOR(X)
 objLayer.Linetype = MyLAYERLINETYPE(X)
 X = Y
 Else
z = z + 1
 End If
 Next X
Next objLayer


'Fixes up solid linetypes in blocks
ThisDrawing.SendCommand "(load " + Chr(34) + "s:/autodesk/vba/ccadblockedit.lsp" + Chr(34) + ")" + vbCr

ThisDrawing.SendCommand "-purge" & vbCr & "lt" & vbCr & "*" & vbCr & "N" & vbCr
' purge linetypes
ThisDrawing.SendCommand "-purge" & vbCr & "b" & vbCr & "*" & vbCr & "n" & vbCr
'purge blocks
' setvar filedia to 0
MsgBox "Linetypes and colours have been reset all the layers"
filediafix:
ThisDrawing.SendCommand "filedia" & vbCr & "1" & vbCr

End Sub
Sub solidlt()
Dim objENT As AcadEntity
Dim ssetObj As AcadSelectionSet
Dim layercode As String
Dim objLayers As AcadLayers
Dim objLayer As AcadLayer

Set ssetObj = ThisDrawing.SelectionSets.Add("MYSss")
ssetObj.Select acSelectionSetAll
ThisDrawing.SendCommand "-linetype" & vbCr & "l" & vbCr & "*" & vbCr & "s:\Autodesk\supportfiles\custom.lin" & vbCr & vbCr
ThisDrawing.SelectionSets.Item("MYSss").Delete
Set objLayers = ThisDrawing.Layers
For Each objLayer In objLayers
 If objLayer.Linetype = "solid" Or objLayer.Linetype = "SOLID" Then
 objLayer.Linetype = "Continuous"
 End If
 
 If objLayer.Linetype = "903" Then
 objLayer.Linetype = "FENCE"
 End If
Next objLayer
ThisDrawing.SendCommand "-purge" & vbCr & "lt" & vbCr & "*" & vbCr & "N" & vbCr
' purge linetypes
ThisDrawing.SendCommand "-purge" & vbCr & "b" & vbCr & "*" & vbCr & "n" & vbCr
'purge blocks
MsgBox "SOLID Linetypes have been reset in the layers"
End Sub

 

civilcad6layercodes.txt is layer (survey code) colour number linetype we have around 200+

 

0                     7 Continuous 
ABUTMENT              1 Continuous 
ALUMINIUM PLUG        1 Continuous 
ARROW                 1 Continuous 
BACK OF KERB          2 DASHED     
BENCH MARK            1 Continuous 

 

CCADblockedit

 

; converts civilcad blocks to bylayer proerties 
 (vl-load-com) 
 (setq adoc (vla-get-activedocument (vlax-get-acad-object))) 
 (vla-startundomark adoc) 
 (vlax-for block (vla-get-blocks adoc) 
   (if   (not (wcmatch (strcase (vla-get-name block) t) "*_space*")) 
     (vlax-for   ent block 
  (vla-put-color ent 0) 
  (vla-put-linetype ent "Bylayer") 
  (vla-put-lineweight ent aclnwtbyblock) 
  ) ;_ end of vlax-for 
     ) ;_ end of if 
   ) ;_ end of vlax-for 
 (vla-regen adoc acactiveviewport) 
 (vla-endundomark adoc) 
 (princ) 

Link to comment
Share on other sites

Ok heres the help you want its in VBA because that was the flavour when I wrote it, a bit of insider info Civilcad uses a 3rd party engine for the writing of DWG files, I dont know why though they decided to have a SHX link probably because it was easier. I will check verison 7.0 and see if it still has the translation table option ccad line = Autocad line.

 

Basicly you need to convert all objects to Bylayer then you can remove the ccad linetype definitions and replace with ACAD ones. see Solid linetype stuff below

 

We had a DOT linetype at the start some drawings would take 10 mins to open lots of tiny dots we got our surveyors to not use it sounds like your Linetype 14 may be similar.

 

For those reading Civilcads linetypes just blow away Autocad so easy to make just draw it and turn it into a linetype.

 

The code is part of a bigger module so I have just cut and pasted the relevant bits.

 

So load in VBAMAN and run ccad6layerfix you will need to edit the linetype names etc to suit

 

Hope this helps post reply if not and I will help further

 

 

I think CivilCad 7 has that feature although it is not one I ever really used. I mostly use Civil 3D now, it is only on existing/old projects where the work was done intially that I would use CivilCad. A lot here still use CivilCad (and rather old versions of it) though as they don't want to learn new software (or even to go from 5 to 6 or 6 to 7)...

Link to comment
Share on other sites

That code looks pretty handy Bigal. I used to manually go into the Layer Properties Manager and adjust each one like your code their does.

Link to comment
Share on other sites

Didn't see the LT bit you could try a script with LT the main thing is select all make by layer then you could change layer characteristics like remove Solid linetype only difference would be that you would have to run a script which has a line for every layer in your drawing, v's a foreach which does all program wise. But if you make script with every layer name from your CCAd library and use CH layer name C LT etc it should still work even if layer does not exist.

 

eg

-la N BOK C 1 LT dashed just repeat for every layer

also Qselect would enable deleting CCAD_point_cross

 

You can export out the CCAD survey library to a txt file as a start

Link to comment
Share on other sites

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...