<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Get File Path for Raster Image in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/get-file-path-for-raster-image/m-p/6526509#M63423</link>
    <description>&lt;P&gt;&lt;SPAN&gt;GetType&lt;/SPAN&gt; has nothing to do with Revit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It&amp;nbsp;is part of the .NET framework, on the base Object class, and cannot be eliminated:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://msdn.microsoft.com/en-us/library/system.object.gettype%28v=vs.110%29.aspx" target="_blank"&gt;https://msdn.microsoft.com/en-us/library/system.object.gettype%28v=vs.110%29.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 27 Aug 2016 09:23:28 GMT</pubDate>
    <dc:creator>jeremytammik</dc:creator>
    <dc:date>2016-08-27T09:23:28Z</dc:date>
    <item>
      <title>Get File Path for Raster Image</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-file-path-for-raster-image/m-p/6517945#M63414</link>
      <description>&lt;P&gt;I am trying to get the filepath for an inserted image.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Looks like RASTER_SYMBOL_FILENAME builtinparameter holds the value (see revit loop up below).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But I am not being able to get the value.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am using the RevitPythonShell and Revit 2015. Below is the code I tried.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Questions:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;- Is get_Parameter still the proper way to get the BIP value? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Found this method being used in several examples, including &lt;A href="http://thebuildingcoder.typepad.com/blog/2011/09/unofficial-parameters-and-bipchecker.html" target="_self"&gt;here&lt;/A&gt;, although it's an old post I think I remember seeing&amp;nbsp;a deprecation msg about this method. I tried .looking for it using Parameter and iterating through GetParameters as as well.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;- Is&amp;nbsp;RASTER_SYMBOL_FILENAME what I should be looking for when trying to find the original img filepath?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks you in advance&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;IronPython 2.7.3 (2.7.0.40) on .NET 4.0.30319.42000 (64-bit)
Type "help", "copyright", "credits" or "license" for more information.
&amp;gt;&amp;gt;&amp;gt; img = selection[0]
&amp;gt;&amp;gt;&amp;gt; img.Category.Name
'Raster Images'
&amp;gt;&amp;gt;&amp;gt; BIP = BuiltInParameter.RASTER_SYMBOL_FILENAME
&amp;gt;&amp;gt;&amp;gt; fname = img.get_Parameter(BIP)
&amp;gt;&amp;gt;&amp;gt; fname
&amp;gt;&amp;gt;&amp;gt; print(fname)
None&lt;BR /&gt; &lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&amp;nbsp;fname = img.&lt;SPAN&gt;Parameter&lt;/SPAN&gt;(BIP)&lt;BR /&gt; &lt;SPAN&gt;Traceback&lt;/SPAN&gt;&amp;nbsp;(most recent call last):&lt;BR /&gt; &amp;nbsp;&amp;nbsp;File&amp;nbsp;&lt;SPAN&gt;"&amp;lt;stdin&amp;gt;"&lt;/SPAN&gt;, line&amp;nbsp;&lt;SPAN&gt;1&lt;/SPAN&gt;,&amp;nbsp;&lt;SPAN&gt;in&lt;/SPAN&gt;&amp;nbsp;&amp;lt;module&amp;gt;&lt;BR /&gt; TypeError: indexer&lt;SPAN&gt;# is not callable&lt;/SPAN&gt; &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2016-08-23 13_23_09-NxDock.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/266208i5CA77923CFC6AD7E/image-size/large?v=v2&amp;amp;px=999" role="button" title="2016-08-23 13_23_09-NxDock.png" alt="2016-08-23 13_23_09-NxDock.png" /&gt;&lt;/span&gt;﻿&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2016 17:52:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-file-path-for-raster-image/m-p/6517945#M63414</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-23T17:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Get File Path for Raster Image</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-file-path-for-raster-image/m-p/6519254#M63415</link>
      <description>&lt;P&gt;Maybe the parameter has not been set and really is null.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can check that using RevitLookup as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, some parameter values cannot be retrieved, because they have more complex values that do not fit into the valid parameter data type list of&amp;nbsp;integer, double, string or element id.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2016 08:18:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-file-path-for-raster-image/m-p/6519254#M63415</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2016-08-24T08:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: Get File Path for Raster Image</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-file-path-for-raster-image/m-p/6519944#M63416</link>
      <description>Hi Jeremy&lt;BR /&gt;I did use revit look up, and the value I am looking for is present, and stored as a string.&lt;BR /&gt;(see previously attached image, bottom right quadrant)</description>
      <pubDate>Wed, 24 Aug 2016 13:43:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-file-path-for-raster-image/m-p/6519944#M63416</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-24T13:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: Get File Path for Raster Image</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-file-path-for-raster-image/m-p/6520152#M63417</link>
      <description>&lt;P&gt;Very weird... almost cannot be... maybe some Python weirdness... sorry, I&amp;nbsp;have no idea.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would suggest you create a reproducible case for this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2016 14:51:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-file-path-for-raster-image/m-p/6520152#M63417</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2016-08-24T14:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: Get File Path for Raster Image</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-file-path-for-raster-image/m-p/6525163#M63418</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;may it be that you try to get the parameter from the image &lt;EM&gt;instance&lt;/EM&gt; ?&lt;/P&gt;
&lt;P&gt;Obviously it is a &lt;EM&gt;type&lt;/EM&gt; parameter, which is attached to the image's ImageType.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Revitalizer&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 14:25:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-file-path-for-raster-image/m-p/6525163#M63418</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2016-08-26T14:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: Get File Path for Raster Image</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-file-path-for-raster-image/m-p/6525704#M63419</link>
      <description>&lt;P&gt;You were spot on. Thank you so much&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1103138"&gt;@Revitalizer﻿&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Here here is a dumb follow up question. I am just starting to get learn the api.&lt;/P&gt;&lt;P&gt;What's the best/most direct method for getting the type of an instance?&lt;/P&gt;&lt;P&gt;I used the GetValidTypes, and it worked. Then I tried just the GetType, and get parameter methods were not available.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;IronPython 2.7.3 (2.7.0.40) on .NET 4.0.30319.42000 (64-bit)
Type "help", "copyright", "credits" or "license" for more information.
&amp;gt;&amp;gt;&amp;gt; img = selection[0]
&amp;gt;&amp;gt;&amp;gt; img.GetValidTypes()
List[ElementId]([&amp;lt;Autodesk.Revit.DB.ElementId object at 0x000000000000002D [245115]&amp;gt;])
&amp;gt;&amp;gt;&amp;gt; for img_type in img.GetValidTypes():
...  print img_type
245115
&amp;gt;&amp;gt;&amp;gt; t = doc.GetElement(img_type)
&amp;lt;Autodesk.Revit.DB.ImageType object at 0x000000000000002E [Autodesk.Revit.DB.ImageType]&amp;gt;
&amp;gt;&amp;gt;&amp;gt; t.Category.Name
'Raster Images'
&amp;gt;&amp;gt;&amp;gt; img.Category.Name
'Raster Images'
&amp;gt;&amp;gt;&amp;gt; t.get_Parameter(BuiltInParameter.RASTER_SYMBOL_FILENAME)
&amp;lt;Autodesk.Revit.DB.Parameter object at 0x000000000000002F [Autodesk.Revit.DB.Parameter]&amp;gt;
&amp;gt;&amp;gt;&amp;gt; p.AsString()
'C:\\Users\\gtalarico\\Pictures\\Solid.jpg'  &amp;lt;&amp;lt;&amp;lt; UHUUU!&lt;/PRE&gt;&lt;PRE&gt;&amp;gt;&amp;gt;&amp;gt; img = selection[0]
[Autodesk.Revit.DB.Element]&amp;gt;
&amp;gt;&amp;gt;&amp;gt; img_type = img.GetType()
&amp;gt;&amp;gt;&amp;gt; img_type.FullName
'Autodesk.Revit.DB.Element'
&amp;gt;&amp;gt;&amp;gt; img_type.get_Parameter(BuiltInParameter.RASTER_SYMBOL_FILENAME)
Traceback (most recent call last):
  File "&amp;lt;stdin&amp;gt;", line 1, in &amp;lt;module&amp;gt;
AttributeError: 'RuntimeType' object has no attribute 'get_Parameter'
&amp;gt;&amp;gt;&amp;gt; &lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Aug 2016 17:49:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-file-path-for-raster-image/m-p/6525704#M63419</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-26T17:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: Get File Path for Raster Image</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-file-path-for-raster-image/m-p/6526279#M63420</link>
      <description>&lt;P&gt;GetTypeId&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2010/08/get-element-type.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2010/08/get-element-type.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 23:20:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-file-path-for-raster-image/m-p/6526279#M63420</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2016-08-26T23:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Get File Path for Raster Image</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-file-path-for-raster-image/m-p/6526299#M63421</link>
      <description>Thanks!&lt;BR /&gt;&lt;BR /&gt;So what is GetType() actually returning of not the Element type?</description>
      <pubDate>Fri, 26 Aug 2016 23:41:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-file-path-for-raster-image/m-p/6526299#M63421</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-26T23:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: Get File Path for Raster Image</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-file-path-for-raster-image/m-p/6526307#M63422</link>
      <description>Ps:&lt;BR /&gt;Here is the tool I'm working on&lt;BR /&gt;It's an image cropper!&lt;BR /&gt;&lt;A href="https://www.dropbox.com/s/hb9zdm82kxx11pm/2016-08-26%2019-29-21.flv?dl=0" target="_blank"&gt;https://www.dropbox.com/s/hb9zdm82kxx11pm/2016-08-26%2019-29-21.flv?dl=0&lt;/A&gt;</description>
      <pubDate>Fri, 26 Aug 2016 23:48:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-file-path-for-raster-image/m-p/6526307#M63422</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-26T23:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: Get File Path for Raster Image</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-file-path-for-raster-image/m-p/6526509#M63423</link>
      <description>&lt;P&gt;&lt;SPAN&gt;GetType&lt;/SPAN&gt; has nothing to do with Revit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It&amp;nbsp;is part of the .NET framework, on the base Object class, and cannot be eliminated:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://msdn.microsoft.com/en-us/library/system.object.gettype%28v=vs.110%29.aspx" target="_blank"&gt;https://msdn.microsoft.com/en-us/library/system.object.gettype%28v=vs.110%29.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Aug 2016 09:23:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-file-path-for-raster-image/m-p/6526509#M63423</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2016-08-27T09:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: Get File Path for Raster Image</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-file-path-for-raster-image/m-p/6526946#M63424</link>
      <description>&lt;P&gt;Many thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/413917"&gt;@jeremytammik﻿&lt;/a&gt;&amp;nbsp;. That makes perfect sense now.&lt;/P&gt;&lt;P&gt;I am coming from python and I am just getting started with .net. I have a long way to go!&amp;nbsp;&lt;img id="smileyindifferent" class="emoticon emoticon-smileyindifferent" src="https://forums.autodesk.com/i/smilies/16x16_smiley-indifferent.png" alt="Smiley Indifferent" title="Smiley Indifferent" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is demo of the final thing working. It's an image cropper for embeded revit images&lt;/P&gt;&lt;P&gt;&lt;A href="https://vimeo.com/180429233?ref=tw-share" target="_blank"&gt;https://vimeo.com/180429233?ref=tw-share&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Aug 2016 20:05:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-file-path-for-raster-image/m-p/6526946#M63424</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-27T20:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: Get File Path for Raster Image</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-file-path-for-raster-image/m-p/11699861#M63425</link>
      <description>&lt;P&gt;Hello;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried gui.talarico image cropper on a image that I copy/pasted from the architect's Revit file into our Revit file. Unfortunately, it failed with an error about "path not found". I check the image type and found that the path points to the architect's path for the image. And I do not have access to the original file. Is there a way to save the pasted image - via the API or the user interface - onto my hard drive?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried to copy/paste the image from the Revit file into a Word document but that fails also. I think the reason might be that Revit copies onto the clipboard a Revit Image Object and not a generic Image Object.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sincerely;&lt;/P&gt;&lt;P&gt;Michelle&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2023 19:51:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-file-path-for-raster-image/m-p/11699861#M63425</guid>
      <dc:creator>michellem</dc:creator>
      <dc:date>2023-01-23T19:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: Get File Path for Raster Image</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-file-path-for-raster-image/m-p/11701165#M63426</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if your ElementType is an ImageType,&lt;/P&gt;
&lt;P&gt;what about "imageType.GetImage()"?&lt;/P&gt;
&lt;P&gt;It returns a Bitmap object which in turn could be saved locally.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2023 09:11:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-file-path-for-raster-image/m-p/11701165#M63426</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2023-01-24T09:11:29Z</dc:date>
    </item>
  </channel>
</rss>

