Re: [Portugal] Off-topic: microstation *.top e catálogos *.cat

Jorge Penedo jorge.penedo at gmail.com
Sun Nov 21 13:27:52 EST 2010


aqui vai o exemplo, de macro que e apresentado pela bentley, que funciona em
Microstatiom Powerdarft ou redline


' Do not use 22352 as your attribute ID. You must obtain a
 ' unique attribute ID from Bentley Systems.

Private Const attrId As Long = 22352
' AddLinkage and GetLinkage both transfer the data using TransferBlock.
 ' That way, it is easy to be certain that the transfer always occur in the
' same order.


Private Sub TransferBlock(dblk As DataBlock, name As String, value As Long,
 _ copyToDataBlock As Boolean)

dblk.CopyString name, copyToDataBlock

dblk.CopyLong value, copyToDataBlock

End Sub



Sub AddLinkage()

 Dim ele As Element <usobjElement.htm>
Dim id As DLong <usudtDLong.htm>
Dim dblk As New DataBlock
id = DLongFromLong <usmthDLongFromLong.htm>(50296)
Set ele = ActiveModelReference <usproActiveModelReference.htm>.
GetElementByID <usmthGetElementByID.htm>(id)
TransferBlock dblk, "Added by User Attributes Example", 50296, True

ele.AddUserAttributeData attrId, dblk
ele.Rewrite <usmthRewrite.htm>

End Sub


Sub GetLinkage()
Dim ele As Element
Dim id As DLong
Dim dblk() As DataBlock
Dim value As Long, name As String

 id = DLongFromLong(50296)
Set ele = ActiveModelReference.GetElementByID(id)
dblk = ele.GetUserAttributeData(attrId)
TransferBlock dblk(0), name, value, False MsgBox "NAME: " & name & ", VALUE:
" & value

End Sub

O numero mágico 22352, não é o do IGP, mas cerio que este esteja patente nos
cadernos de encargos
da produção de cartografia. informação que está no site do instituto.


Creio que para o uso de outras plataformas, mdl  ou outra , seja necessário
esse dado.




---------- Mensagem encaminhada ----------
De: Luis Miguel <lmikegeo  yahoo.com>
Data: 20 de Novembro de 2010 22:24
Assunto: Re: [Portugal] Off-topic: microstation *.top e catálogos *.cat
Para: portugal  lists.osgeo.org



Na sequência deste assunto, aproveitei para seguir a pista da
dgnlib<http://dgnlib.maptools.org/>.
Esta lê mesmo "user data linkages"
Depois de compilar o dgndump.c contra a dgnlib obtive resultados do género:
-------------------------------------
Element:Line String  Level:21 id:29
  offset=7738  size=98 bytes
  graphic_group:0   color:0 weight:0 style:0
  properties=3584,ATTRIBUTES,MODIFIED,NEW
  (1110.290000,-160198.930000,0.000000)
  (985.480000,-160315.660000,0.000000)
  (882.280000,-160408.570000,0.000000)
Attributes (24 bytes):
Type=0x1995
  0x0310951903020103
Type=0x1995
  0x0310951901100303
Type=0x1995
  0x0310951902110101

----------

Estes três últimos atributos correspondem às "user data linkages". Note-se a
assinatura do IPCC ("0x1995")

Curiosamente, o mesmo não se passa com a OGR. Para a mesma feature:

ogrinfo -al -fid 29 --config DGN_LINK_FORMAT "STRING" teste.dgn

-------
OGRFeature(elements):29
  Type (Integer) = 4
  Level (Integer) = 21
  GraphicGroup (Integer) = 0
  ColorIndex (Integer) = 0
  Weight (Integer) = 0
  Style (Integer) = 0
  EntityNum (Integer) = (null)
  MSLink (Integer) = (null)
  Text (String) = (null)
  Style = PEN(id:"ogr-pen-0",c:#fcfcfc)
  LINESTRING (1110.29 -160198.92999999999 0,985.48000000000002 -160315.66
0,882.27999999999997 -160408.57000000001 0)
-----------------------------------

Fui ver o código
http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrsf_frmts/dgn/ogrdgnlayer.cpp
e aparentemente só lê MSLink e EntityNum (ver chamada da função
"DGNGetLinkage")

Alguém tentou seguir este caminho (OGR ou DGNLib)?

Cumps

Luis Tavares


_______________________________________________
Portugal mailing list
Portugal  lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/portugal
-------------- próxima parte ----------
Um anexo em HTML foi limpo...
URL: http://lists.osgeo.org/pipermail/portugal/attachments/20101121/4c9e1492/attachment.html


More information about the Portugal mailing list