Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SketchDimension Does Not Work

21 REPLIES 21
SOLVED
Reply
Message 1 of 22
tperam
615 Views, 21 Replies

SketchDimension Does Not Work

 

Hi,
    SketchDimension in the following C++ Sample Program: Programming Interface Sample Programs Modeling Sketches Create sketch lines in various ways,

https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-98e163be-fd07-11e4-9c39-3417ebd3d5be

does not work.

 

I copied the whole program in the sample.

Please help.
Thurai

////////////////////////////////////////
Ptr<SketchDimensions> sketchDimensions = sketch->sketchDimensions();
if(!sketchDimensions)
return false;
Ptr<SketchDimension> sketchDimension = sketchDimensions->addDistanceDimension(recLines->item(0)->startSketchPoint(), recLines->item(0)->endSketchPoint(), HorizontalDimensionOrientation, Point3D::create(5.5, -1, 0));
if(!sketchDimension)
return false;

////////////////////////////////////////

Labels (2)
21 REPLIES 21
Message 2 of 22
tperam
in reply to: tperam

I Noticed, in the Sample Program sketchDimension is called before reclines were drawn.

 

I reversed the order as below. Still it did not work.

 

Thurai

//////////////////////////////

 

// Draw a rectangle by three points.
recLines = sketchLines->addThreePointRectangle(Point3D::create(8, 0, 0), Point3D::create(11, 1, 0), Point3D::create(9, 3, 0));
if(!recLines)
return false;

// Draw a rectangle by a center point.
recLines = sketchLines->addCenterPointRectangle(Point3D::create(14, 3, 0), Point3D::create(16, 4, 0));
if(!recLines)
return false;

Ptr<SketchDimensions> sketchDimensions = sketch->sketchDimensions();
if(!sketchDimensions)
return false;
Ptr<SketchDimension> sketchDimension = sketchDimensions->addDistanceDimension(recLines->item(0)->startSketchPoint(), recLines->item(0)->endSketchPoint(), HorizontalDimensionOrientation, Point3D::create(5.5, -1, 0));
if(!sketchDimension)
return false;

// Draw some circles.
Ptr<SketchCircles> circles = sketchCurves->sketchCircles();
if (!circles)
return false;

Ptr<SketchCircle> circle1 = circles->addByCenterRadius(Point3D::create(0, 0, 0), 2);
if (!circle1)
return false;

Ptr<SketchDimension> sketchDimensionCircle1 = sketchDimensions->addRadialDimension(circle1, Point3D::create(1, 1, 0));

 

//////////////////////////////////

Message 3 of 22
nnikbin
in reply to: tperam

The sample works fine for me just by copying the code and pasting it. Here is the screenshot of editing the created sketch:

 

56.png

Message 4 of 22
nnikbin
in reply to: tperam

You can download my project file to see if there is any difference with your one:

https://drive.google.com/file/d/1MqBpqeY72U95Ic7BVP9a6VuaSMUAI3qx/view?usp=sharing

Message 5 of 22
tperam
in reply to: nnikbin

Hi nnikbin,

                  I copied your code and project to my pc. I could not tools -> attach to process.

 

But I copied the code again and ran.  When I hover the mouse the dimension line, the dimension 30.00 shows up, and the right hand bottom corner shows "dimension",  but when I move the mouse away, it hides.

 

Strange. Anyway it looks like the dimension is working.  the issue for me is to keep the dimension displayed. May have to do with my fusion setup?

 

Thanks nnikbin.

Thurai

 

                  

Message 6 of 22
BrianEkins
in reply to: tperam

Sketch dimensions are only visible when the sketch is active.  If the sketch is active and you're only seeing the dimension when you move the mouse over the dimension, my first guess is some graphics issue.  In the help menu, there is a "Support and Diagnostics" item and it has a "Graphics Diagnostics" command.  There is a "Troubleshooting" section at the bottom of the dialog.  Maybe try that and see if it helps.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 7 of 22
nnikbin
in reply to: tperam

Do the dimensions you create in the user interface behave similarly?

Is "Show Dimensions" check box checked in "Sketch Palette"?

57.png

Message 8 of 22
tperam
in reply to: tperam

Hi nnikbin, Brian,

                               UI works well. 

 

I have this display issue only in API.

 

Even some sketchlines have the same issue.  When I hover over with the mouse, they display, otherwise some of them are faint.

 

Thanks,

Thurai

 

 

 

 

Message 9 of 22
tperam
in reply to: tperam

Hi nnikbin,

                   "Show Dimensions" check box is checked in "Sketch Palette".

 

Thurai

Message 10 of 22
BrianEkins
in reply to: tperam

I don't understand what you mean when you say you only have this problem with the API.  Do you mean this only happens with dimensions that have been created with the API?  So far, no one else has been able to reproduce the problem you're seeing but that could be because we're not doing the same steps as you. Can you provide specific steps to reproduce the problem?  Maybe a video that shows the steps and illustrates specifically what you're seeing.

 

Another thing to test.  If you save, close, and reopen the design do the dimensions still demonstrate the problem? If so, can you attach an f3d that has problem dimensions that we can open to see if we have the problem too?

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 11 of 22
tperam
in reply to: BrianEkins

Hi Brian, nnikbin,

 

As per your suggestion earlier, I opened the graphics diagnostics. It sys GPU RAM: 32 MB, Driver: DirectX 9.0,
Driver Version: 10.18.10.4358, Driver Date: 05/04/2016. I checked for driver update. It came up with several drivers.
My processor is Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz 3.40 GHz. I have Windows 10 Professional.

I think as Brian suspected, my graphics driver is obsolete. It shows up several drivers. I Chose Intel HD Graphics Family.


It asks for which type. It lists several types staring from Intel HD Graphics 500 to Intel HD Graphics P630.
I am not sure which type to download and install.

 

I am attaching the f3d file and the png files

 

Thanks,
Thurai

Message 12 of 22
tperam
in reply to: tperam

Hi nnikbin, Brian,

 

I applologize for having been side tracked by other matters.

 

I was able to find the Graphic driver guided by Intel, which is a much recent version. I downloaded it and installed it.

I was hoping it would have solved the problem. But unfortunately still I have the same issue when I run TestSketchLines either copying and pasting from the Sample Code or Copying the project sent by nnikbin.

 

Then I tried the same think in my laptop. It is doing the same thing, that is dimension is not visible.

 

I have the Fusion 360 version as below:
2.0.10564
Active Plan: Fusion 360, Subscription
Windows 10 (19043)

 

I uninstalled Microsoft.asp.net.mvc-2 Visual Strudio 2010 Tools.

 

Uninstalled Fusion 360. Reinstalled it.

 

I got the message " The File C:\Windows\MicroSoft.Net\Framework\V.2.0.50727\Microsoft.Vsa.tlb could not be loaded. An attempt to repair this file failed, because the file could not be found. Please install this program. "

 

I downloaded Microsoft Visual C++ 2010 Service Pack 1 Redistributable Package MFC Security Update and Installed.

 

It said the following feature was successfully installed: .Net Framework 3.5(Includes Net.2.0 and 3.0).

Still when I try to edit a C++ program in Visual Studio, it says the Visual C++ Project "SketchLines" is targetting ".Net.Framework,Version v4.0 which is not installed in this machine.

I am trying to get this one installed.


Thanks,
Thurai

 

Message 13 of 22
tperam
in reply to: tperam

Hi,
I downloaded dotNetFx40_Full_setup and tried to installed.

 

Windows responded in the Microsoft .Net Framework 4 setup saying that " your installation did not occur because it is already part of this operating system. You do not need to install it."

 

But when I try to edit a C++ program, Visual Studio is reponding by it says the Visual C++ Project "SketchLines" is targetting ".Net.Framework,Version v4.0 which is not installed in this machine.

 

Thanks,

Thurai

Message 14 of 22
tperam
in reply to: tperam

I posted the Question to Microsoft in the following  website:

 

https://docs.microsoft.com/en-us/answers/questions/526194/microsoftvsatlb-could-not-be-loaded-an-att...

 

Thurai

Message 15 of 22
tperam
in reply to: tperam

Hi,

    I downloaded the latest steady version of Visual Studio that is VS 2019, compiled and Ran.

 

Still no difference.

 

To me it looks like it has something to do with Fusion 360 settings.

 

Thurai

Message 16 of 22
nnikbin
in reply to: tperam

Like @BrianEkins I guess there may be a graphics issue. I suggest changing Windows display settings like display resolution, size of text and refresh rate to see if a changes occurs.

Message 17 of 22
tperam
in reply to: nnikbin

Thanks nnikbin,

                            I played with the Display settings in UI and Graphics settings in Preferences.

 

So far no luck.

 

Thurai

Message 18 of 22
nnikbin
in reply to: tperam

Thank you @tperam for the update.

It's very strange that it seems the API abstraction layer works somehow differently than UI. I hope Autodesk can find the root of the issue. it deserves thorough investigation.

Message 19 of 22
tperam
in reply to: nnikbin

Hi nnikbin, Brian,


I have posted the question to Fusion support help. They have opened a case.

 

Thanks,
Thurai

Message 20 of 22
tperam
in reply to: tperam

Hi nnikbin, Brian, Tasha Addington,

 

as I mentioned earlier, I posted the question to the Fusion support Team.


Tasha Addington from the Fusion support team, walked me to set the visibility on in the browser sketch1 menu.


Then dimension became visible.


In my API somehow dimension visibility is turned off by default.


I would like to thank nnikbin, Brian and Tasha Addington.


Thurai

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report