<?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 Dimension alignment issue in PDF after exporting to PDF using .NET, C# in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/dimension-alignment-issue-in-pdf-after-exporting-to-pdf-using/m-p/13780329#M85670</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; I have a C# code of updating the custom made "T" dynamic block properties and after updating the properties Distance1, Distance2, Distance3. I'm exporting to pdf from Model space. But facing issue with the alignment of the dimensions in PDF. Attaching the video for reference, kindly go&lt;/P&gt;&lt;P&gt;through and help me. Thanks in advance.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;div class="lia-vid-container video-embed-left"&gt;&lt;div id="lia-vid-6377311674112w400h225r647" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6377311674112" data-account="6057940548001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6057940548001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6377311674112w400h225r647');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://forums.autodesk.com/t5/video/gallerypage/video-id/6377311674112"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 24 Aug 2025 07:43:03 GMT</pubDate>
    <dc:creator>madhukum339</dc:creator>
    <dc:date>2025-08-24T07:43:03Z</dc:date>
    <item>
      <title>Dimension alignment issue in PDF after exporting to PDF using .NET, C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/dimension-alignment-issue-in-pdf-after-exporting-to-pdf-using/m-p/13780329#M85670</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; I have a C# code of updating the custom made "T" dynamic block properties and after updating the properties Distance1, Distance2, Distance3. I'm exporting to pdf from Model space. But facing issue with the alignment of the dimensions in PDF. Attaching the video for reference, kindly go&lt;/P&gt;&lt;P&gt;through and help me. Thanks in advance.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;div class="lia-vid-container video-embed-left"&gt;&lt;div id="lia-vid-6377311674112w400h225r287" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6377311674112" data-account="6057940548001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6057940548001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6377311674112w400h225r287');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://forums.autodesk.com/t5/video/gallerypage/video-id/6377311674112"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Aug 2025 07:43:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dimension-alignment-issue-in-pdf-after-exporting-to-pdf-using/m-p/13780329#M85670</guid>
      <dc:creator>madhukum339</dc:creator>
      <dc:date>2025-08-24T07:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension alignment issue in PDF after exporting to PDF using .NET, C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/dimension-alignment-issue-in-pdf-after-exporting-to-pdf-using/m-p/13780465#M85671</link>
      <description>&lt;P&gt;You didn't post your .NET code, so you're not going to get much help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From the video, Task.dwg&amp;nbsp;is not saved after MAPDIM, so I'm guessing you're plotting the original file (from filepath), in lieu of the unsaved changes in the active document.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Aug 2025 12:43:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dimension-alignment-issue-in-pdf-after-exporting-to-pdf-using/m-p/13780465#M85671</guid>
      <dc:creator>BlackBox_</dc:creator>
      <dc:date>2025-08-24T12:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension alignment issue in PDF after exporting to PDF using .NET, C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/dimension-alignment-issue-in-pdf-after-exporting-to-pdf-using/m-p/13780600#M85672</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1206685"&gt;@BlackBox_&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attaching the code, kindly go through and let me know, if this helps to answer. Thank you,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Aug 2025 16:41:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dimension-alignment-issue-in-pdf-after-exporting-to-pdf-using/m-p/13780600#M85672</guid>
      <dc:creator>madhukum339</dc:creator>
      <dc:date>2025-08-24T16:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension alignment issue in PDF after exporting to PDF using .NET, C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/dimension-alignment-issue-in-pdf-after-exporting-to-pdf-using/m-p/13781935#M85673</link>
      <description>&lt;P&gt;Thanks; I'm (happy?) sad to report that this code is working on my end.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, since you only shared a few methods, and not an entire class with the missing dependencies (like taskPath, doc, your custom Block, etc), I had to create my own CommandMethod using&amp;nbsp;Application.GetSystemVariable("DWGPREFIX").ToString() for taskpath, and&amp;nbsp;Application.DocumentManager.MdiActiveDocument for doc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Otherwise, it worked quite well - with such a small test drawing, it was near instant, so I'm curious to test it on my normal (large) C3D drawings.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One thing that stood out from &lt;A href="https://www.keanw.com/2007/09/driving-a-basic.html" target="_blank" rel="noopener"&gt;Kean's example here&lt;/A&gt;, is that your&amp;nbsp;PublishModelSpaceToPdf() method includes tr.Commit() where Kean does not - that said, both leaving it as-is and commenting it out resulted in a successful plot of the unsaved changes I was making to a polyline &amp;amp; dimensions I used as placeholder for your Block.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Mon, 25 Aug 2025 15:20:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dimension-alignment-issue-in-pdf-after-exporting-to-pdf-using/m-p/13781935#M85673</guid>
      <dc:creator>BlackBox_</dc:creator>
      <dc:date>2025-08-25T15:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension alignment issue in PDF after exporting to PDF using .NET, C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/dimension-alignment-issue-in-pdf-after-exporting-to-pdf-using/m-p/13782773#M85674</link>
      <description>&lt;P&gt;Thanks for your reply &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1206685"&gt;@BlackBox_&lt;/a&gt;&amp;nbsp;, have you checked with dimension alignment in pdf after updating dynamic block properties. attaching the rest of the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached the .dwg and .pdf for reference at the top.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="madhukum339_0-1756186529028.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1564524i2C572390BFAE9001/image-size/medium?v=v2&amp;amp;px=400" role="button" title="madhukum339_0-1756186529028.png" alt="madhukum339_0-1756186529028.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Aug 2025 05:38:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dimension-alignment-issue-in-pdf-after-exporting-to-pdf-using/m-p/13782773#M85674</guid>
      <dc:creator>madhukum339</dc:creator>
      <dc:date>2025-08-26T05:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension alignment issue in PDF after exporting to PDF using .NET, C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/dimension-alignment-issue-in-pdf-after-exporting-to-pdf-using/m-p/13783641#M85676</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/16750797"&gt;@madhukum339&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks to me, your code is problematic: the class level variable "plot" is initialized as "false", and never changed, thus, the last 2 lines of code in the command method:&lt;/P&gt;
&lt;P&gt;if (plot)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; PublishModelSpaceToPdf()&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is never executed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, your have the save 2 lines of code in the ProcessDimensions() method, and inside of it, you have a local variable "plot", which can be set to true, thus the plotting may get proceeded within the ProcessDimensions() method.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If executing built-in command "DIMREGEN" is the intention to update the dimensions in the dynamic block BEFORE plotting (I am not sure if it works without trying it myself), then it is obviously has no effect as you wished.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, you need to fix your code like this:&lt;/P&gt;
&lt;P&gt;1. Remove last a 2 or 3 lines of code from the ProcessDimensions(). That is, do not do the plotting inside the ProcessDimensions() method;&lt;/P&gt;
&lt;P&gt;2. Let ProcessDimentions() return true/false; that is, when the dynamic block(s) with dimension is/are updated, the method would return true, meaning plotting is needed after the dimensions are processed.&lt;/P&gt;
&lt;P&gt;3. If "DIMREGEN" indeed fix the dimension's offset in the dynamic plot, you DO NOT call in with SendStringToExecute(), because it would not be executed BEFORE your command method finishes. You can try Editor.Command("DIMREGEN") instead.&lt;/P&gt;
&lt;P&gt;4. You need to get system variable "BACKGROUNDPLOT" to 0, not 3!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, I'd not recommend post code as picture, or as attachment (unless there is huge number of lines of code), it makes commenting your code rather difficult: I have constantly/repeatedly leave the comment text window and open the attached code file/picture to look at the code, and then close it and go back to the comment window to continue. Use the "&amp;lt;/&amp;gt;" button to copy/paste code, so that the code can be browsed while commenting by simply scrolling the web page. Much easier.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Sep 2025 11:33:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dimension-alignment-issue-in-pdf-after-exporting-to-pdf-using/m-p/13783641#M85676</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2025-09-03T11:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension alignment issue in PDF after exporting to PDF using .NET, C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/dimension-alignment-issue-in-pdf-after-exporting-to-pdf-using/m-p/13794172#M85696</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@norman.yuan&lt;/a&gt;, this line fixed the issue.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Editor.Command("DIMREGEN")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Sep 2025 08:20:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dimension-alignment-issue-in-pdf-after-exporting-to-pdf-using/m-p/13794172#M85696</guid>
      <dc:creator>madhukum339</dc:creator>
      <dc:date>2025-09-03T08:20:07Z</dc:date>
    </item>
  </channel>
</rss>

