Search the Knowledge Base Report a bug
Post new topic   Reply to topic   printer-friendly view   .    ArchiCAD-Talk Forum Index >>> Developer Forum >>> [SOLVED] Level Dimension dimForm not recognizing symbols
View previous topic :: View next topic
Author Message
Erenford
New member
New member

Joined: 30 Jun 2014
Posts: 27
Location: Philippines, Makati City

PostPosted: Tue Nov 29, 2016 9:56 am    Post subject: [SOLVED] Level Dimension dimForm not recognizing symbols Reply with quote

Greetings, I've tried creating a Level Dimension element with 'dimForm' set to 10 and after creation it reverts back to 0. Even if I don't set it thru code (just the ACAPI_Element_GetDefaults) but set the symbol thru ArchiCAD as default it still reverts back to 0 upon creation of element. Further experimentation reveals values 10 and above are not being recognize by API; these are also symbols not in the documentation.

I've attached a picture with all the symbols and respective values along with the documentation with symbol pic. Circled ones are not being accepted.

Any solution for this?



Level Dimension dimForm.PNG
 Description:
 Filesize:  50.15 KB
 Viewed:  104 Time(s)

Level Dimension dimForm.PNG



_________________
Archicad 18 6101 INT FULL
Archicad 19 3003 INT FULL
Archicad 20 3012 INT FULL
Win 7 Pro SP 1 64-bit
Intel Core i7-2600 CPU @3.40GHz


Last edited by Erenford on Thu Jul 06, 2017 6:42 am; edited 1 time in total
Back to top
View user's profile Send private message    
Erenford
New member
New member

Joined: 30 Jun 2014
Posts: 27
Location: Philippines, Makati City

PostPosted: Fri Dec 02, 2016 3:50 am    Post subject: Re: (Bug?) Level Dimension dimForm not recognizing some symb Reply with quote

I've experimented a little bit and found a partial solution and another problem. Since the symbol I need is available from the accepted ones only that the text is different, I just used 'dimForm = 0' (with superscripted text) then adjusted the text position for my liking.

The problem I encountered is that "create -> adjust" only works for static level, for the attached with parent type the ACAPI_Element_Change throws out a APIERR_GENERAL.

I've also notice that the dimForm documentation image is updated on AC20 (same as the options in Lvl Dim settings) unlike before on AC19, but it's still not working though (the testing below is done using AC20 v3012)

Testing:
- Set the Lvl Dim with note1.pos already adjusted then create -> Does not apply the position

- Create the Lvl Dim as static then adjust note1.pos then change -> Success

- Create the Lvl Dim with parent then set (or even nothing, just cleared mask) then change -> APIERR_GENERAL

- Create with dimForm as 10+ -> Will not apply, reverts back to value 0

- Change the element (after creation and as static type) dimForm to 10+ -> Does not also work, reverts to value 0

The code I used:
Code:

void CreateLevelDimension(API_Element& i_elemParent)
{
   API_Element elem;
   GSErrCode err = NoError;
   BNZeroMemory(&elem, sizeof(elem));
   elem.header.typeID = API_LevelDimensionID;
   err = ACAPI_Element_GetDefaults(&elem, nullptr);
   if (err != NoError)
   {
      DBGPrintlnf("["__FUNC__"] ERROR %s - ACAPI_Element_GetDefaults", ErrId2Name(err));
      return;
   }
   // get the center of the element
   tdv_Coord coordList = GetMemoCoords(i_elemParent, false);
   API_Coord centerPoly = GetPolyCentroid(coordList, false);
   elem.levelDimension.loc = centerPoly;

//    elem.levelDimension.dimForm = 4;

   // static type
   elem.levelDimension.staticLevel = true;
   // attached to parent
//    elem.levelDimension.staticLevel = false;
//    elem.levelDimension.parentGuid = i_elemParent.header.guid;
//    elem.levelDimension.parentType = i_elemParent.header.typeID;

   ACAPI_CallUndoableCommand("Create Level Dimension", [&] () -> GSErrCode {
   err = ACAPI_Element_Create(&elem, nullptr);
   return NoError; });
   if (err != NoError)
   {
      DBGPrintlnf("["__FUNC__"] ERROR %s - ACAPI_Element_Create", ErrId2Name(err));
      return;
   }

   // Get the newly created element then change the text position
   err = ACAPI_Element_Get(&elem);
   if (err != NoError)
   {
      DBGPrintlnf("["__FUNC__"] ERROR %s - ACAPI_Element_Get()", ErrId2Name(err));
      return;
   }
      
//    elem.levelDimension.dimForm = 14;
   // Adjust the text
   elem.levelDimension.note1.pos.x += 0.125;
   elem.levelDimension.note1.pos.y += -0.375;

   API_Element elemMask;
   ACAPI_ELEMENT_MASK_CLEAR(elemMask);
   ACAPI_ELEMENT_MASK_SET(elemMask, API_LevelDimensionType, note1.pos);
//    ACAPI_ELEMENT_MASK_SET(elemMask, API_LevelDimensionType, dimForm);

   ACAPI_CallUndoableCommand("Change Element", [&] () -> GSErrCode {
   err = ACAPI_Element_Change(&elem, &elemMask, nullptr, NULL, true);
   return NoError; });
   if (err != NoError)
   {
      DBGPrintlnf("[Error] %s "__FUNC__" - ACAPI_Element_Change()", ErrId2Name(err));
   }
}

_________________
Archicad 18 6101 INT FULL
Archicad 19 3003 INT FULL
Archicad 20 3012 INT FULL
Win 7 Pro SP 1 64-bit
Intel Core i7-2600 CPU @3.40GHz
Back to top
View user's profile Send private message    
KatalinBorszeki
Graphisoft

Joined: 18 Jan 2013
Posts: 330
Location: Hungary

PostPosted: Thu Feb 09, 2017 2:00 pm    Post subject: Re: (Bug?) Level Dimension dimForm not recognizing some symb Reply with quote

Hi Erenford, this is an error on our end. Thanks for letting us know, we have entered it in the development database and planning to fix it soon.
Best, k

_________________
Katalin Borszeki
Implementation Specialist
GRAPHISOFT

http://helpcenter.graphisoft.com - the ArchiCAD knowledge base
Back to top
View user's profile Send private message Visit poster's website    
Erenford
New member
New member

Joined: 30 Jun 2014
Posts: 27
Location: Philippines, Makati City

PostPosted: Tue Jul 04, 2017 5:45 am    Post subject: New issues for Dimension (using Elevation Dimension) Reply with quote

Hello again, I found some issues about Dimensions this time and it looks like its related to this so I'll just post it here.

This is when creating Elevation Dimensions (dimension.dimAppear = APIApp_Elev):
1. On ACAPI_Element_Create, dimension.ed_dimForm accepts values 1-5 but not 0, 6, 7 (see left image for reference). If those values are passed it reverts back to symbol 1.

2. When dimension.ed_dimForm = 5, I've tried looking up which of API_DimensionType variables corresponds to the settings dialog (see right image for ref) and I can't figure out which one affects the "Level Dimension Marker Style" (green circled on the image). If I pick the 1st one then displayed the struct's values, it's the same values when I then pick the 2nd or 3rd style.
On creation though it doesn't revert to a default value, it uses whatever the chosen style on the default settings dialog, even if ed_dimForm = 5 is not currently the default.
Any help on this?

Thanks for the help.



Dimension - ElevDim.png
 Description:
 Filesize:  104.91 KB
 Viewed:  20 Time(s)

Dimension - ElevDim.png



_________________
Archicad 18 6101 INT FULL
Archicad 19 3003 INT FULL
Archicad 20 3012 INT FULL
Win 7 Pro SP 1 64-bit
Intel Core i7-2600 CPU @3.40GHz
Back to top
View user's profile Send private message    
Akos Somorjai
Graphisoft

Joined: 26 May 2004
Posts: 172
Location: Budapest

PostPosted: Tue Jul 04, 2017 1:15 pm    Post subject: Re: New issues for Dimension (using Elevation Dimension) Reply with quote

Erenford wrote:
Hello again, I found some issues about Dimensions this time and it looks like its related to this so I'll just post it here.

This is when creating Elevation Dimensions (dimension.dimAppear = APIApp_Elev):
1. On ACAPI_Element_Create, dimension.ed_dimForm accepts values 1-5 but not 0, 6, 7 (see left image for reference). If those values are passed it reverts back to symbol 1.

2. When dimension.ed_dimForm = 5, I've tried looking up which of API_DimensionType variables corresponds to the settings dialog (see right image for ref) and I can't figure out which one affects the "Level Dimension Marker Style" (green circled on the image). If I pick the 1st one then displayed the struct's values, it's the same values when I then pick the 2nd or 3rd style.
On creation though it doesn't revert to a default value, it uses whatever the chosen style on the default settings dialog, even if ed_dimForm = 5 is not currently the default.
Any help on this?

Thanks for the help.


Hi Erenford,

The first issue has been fixed in AC20 build 5518, so any update with a higher build number contains the fix.

The second issue is another a bug, thanks for pointing out!

Best, Akos
Back to top
View user's profile Send private message    
Erenford
New member
New member

Joined: 30 Jun 2014
Posts: 27
Location: Philippines, Makati City

PostPosted: Thu Jul 06, 2017 6:39 am    Post subject: Re: New issues for Dimension (using Elevation Dimension) Reply with quote

Thanks Akos I'll update my AC20 then check it again
_________________
Archicad 18 6101 INT FULL
Archicad 19 3003 INT FULL
Archicad 20 3012 INT FULL
Win 7 Pro SP 1 64-bit
Intel Core i7-2600 CPU @3.40GHz
Back to top
View user's profile Send private message    
Display posts from previous:   
View previous topic :: View next topic
Post new topic   Reply to topic   printer-friendly view       ArchiCAD-Talk Forum Index >>> Developer Forum >>> [SOLVED] Level Dimension dimForm not recognizing symbols All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB 2001, 2005 phpBB Group
Copyright 2012 - Graphisoft SE. All rights reserved worldwide. Terms of Use | Privacy Policy