<br>aqui vai o exemplo, de macro que e apresentado pela bentley, que funciona em Microstatiom Powerdarft ou redline<br><br>  <br>&#39;  Do not use 22352 as your attribute ID.  You must obtain a<br> &#39;  unique attribute ID from Bentley Systems.
<br><br>Private Const attrId As Long = 22352
<br>&#39;  AddLinkage and GetLinkage both transfer the data using TransferBlock.<br> &#39;  That way, it is easy to be certain that the transfer always occur in the
<br>&#39;  same order.
<br><br><br>Private Sub TransferBlock(dblk As DataBlock, name As String, value As Long,<br> _
                   copyToDataBlock As Boolean)
    <br><br>dblk.CopyString name, copyToDataBlock
    <br><br>dblk.CopyLong value, copyToDataBlock
<br><br>End Sub
<br><br><br><br>Sub AddLinkage()<br><br> Dim ele As <a href="usobjElement.htm">Element</a>
    <br>Dim id As <a href="usudtDLong.htm">DLong</a>
    <br>Dim dblk As New DataBlock
    
    <br>id = <a href="usmthDLongFromLong.htm">DLongFromLong</a>(50296)
    
    <br>Set ele = <a href="usproActiveModelReference.htm">ActiveModelReference</a>.<a href="usmthGetElementByID.htm">GetElementByID</a>(id)
    
    <br>TransferBlock dblk, &quot;Added by User Attributes Example&quot;, 50296, True
    
    <br><br>ele.AddUserAttributeData attrId, dblk
    <br>ele.<a href="usmthRewrite.htm">Rewrite</a>
<br><br>End Sub

<br><br><br>Sub GetLinkage()
    <br>Dim ele As Element
    <br>Dim id As DLong
    <br>Dim dblk() As DataBlock
    <br>Dim value As Long, name As String<br><br> id = DLongFromLong(50296)
    
    <br>Set ele = ActiveModelReference.GetElementByID(id)
    <br>dblk = ele.GetUserAttributeData(attrId)
    <br>TransferBlock dblk(0), name, value, False
    MsgBox &quot;NAME: &quot; &amp; name &amp; &quot;, VALUE: &quot; &amp; value
<br><br>End Sub
<br><br>O numero mágico 22352, não é o do IGP, mas cerio que este esteja patente nos cadernos de encargos<br>da produção de cartografia. informação que está no site do instituto.<br><br><br>Creio que para o uso de outras plataformas, mdl  ou outra , seja necessário esse dado.<br>
  <br><br><br><br><div class="gmail_quote">---------- Mensagem encaminhada ----------<br>De: <b class="gmail_sendername">Luis Miguel</b> <span dir="ltr">&lt;<a href="mailto:lmikegeo@yahoo.com">lmikegeo@yahoo.com</a>&gt;</span><br>
Data: 20 de Novembro de 2010 22:24<br>Assunto: Re: [Portugal] Off-topic: microstation *.top e catálogos *.cat<br>Para: <a href="mailto:portugal@lists.osgeo.org">portugal@lists.osgeo.org</a><br><br><br><div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">

<div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div><br>Na sequência deste assunto, aproveitei para seguir a pista da <a href="http://dgnlib.maptools.org/" target="_blank"><span style="font-style: italic;">dgnlib</span></a>. Esta lê mesmo &quot;user data linkages&quot;<br>
Depois de compilar o dgndump.c contra a dgnlib obtive resultados do género:<br>-------------------------------------<br>Element:Line String  Level:21 id:29     <br>  offset=7738  size=98 bytes<br>  graphic_group:0   color:0 weight:0 style:0<br>
  properties=3584,ATTRIBUTES,MODIFIED,NEW<br>  (1110.290000,-160198.930000,0.000000)<br>  (985.480000,-160315.660000,0.000000)<br>  (882.280000,-160408.570000,0.000000)<br>Attributes (24 bytes):<br>Type=0x1995<br>  0x0310951903020103<br>
Type=0x1995<br>  0x0310951901100303<br>Type=0x1995<br> 
 0x0310951902110101<br><br>----------<br><br>Estes três últimos atributos correspondem às &quot;user data linkages&quot;. Note-se a assinatura do IPCC (&quot;0x1995&quot;)<br><br>Curiosamente, o mesmo não se passa com a OGR. Para a mesma feature:<br>
<br>ogrinfo -al -fid 29 --config DGN_LINK_FORMAT &quot;STRING&quot; teste.dgn <br><br>-------<br>OGRFeature(elements):29<br>  Type (Integer) = 4<br>  Level (Integer) = 21<br>  GraphicGroup (Integer) = 0<br>  ColorIndex (Integer) = 0<br>
  Weight (Integer) = 0<br>  Style (Integer) = 0<br>  EntityNum (Integer) = (null)<br>  MSLink (Integer) = (null)<br>  Text (String) = (null)<br>  Style = PEN(id:&quot;ogr-pen-0&quot;,c:#fcfcfc)<br>  LINESTRING (1110.29 -160198.92999999999 0,985.48000000000002 -160315.66 0,882.27999999999997 -160408.57000000001 0)<br>
-----------------------------------<br><br>Fui ver o código  <a href="http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrsf_frmts/dgn/ogrdgnlayer.cpp" target="_blank">http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrsf_frmts/dgn/ogrdgnlayer.cpp</a><br>
e aparentemente só lê MSLink e EntityNum (ver chamada da função &quot;DGNGetLinkage&quot;)<br><br>Alguém tentou seguir este caminho (OGR ou DGNLib)?<br><br>Cumps<br><br>Luis Tavares<br></div>
</div>
</div><br>

      </div><br>_______________________________________________<br>
Portugal mailing list<br>
<a href="mailto:Portugal@lists.osgeo.org">Portugal@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/portugal" target="_blank">http://lists.osgeo.org/mailman/listinfo/portugal</a><br>
<br></div><br>