Macro export unfolded dxf BIS

Can you repost the code you use? I can't find this variable in the last 2 files I posted, nor in the one you posted 2 hours ago:

macro.txt

 

1 Like

Of course my little Lucas =)

 

Here is the "final" code where all you have to do is insert the variable. (well I think^^)

 


macro_final.txt

Sorry, I'm not awake!

It's not smmoddoc but swModel that you should use! That's what it's like to reuse snippets of code right and left, without carefully rereading yourself!

See the attached file.


macro-dxf-bart.txt
2 Likes

Oops, I just checked, and for the properties of the configurations, it's different! So it shouldn't work!

1 Like

Exactly Lucas.

That's why I thought it's better to explain @ Bart so that he understands his code than to make him a turnkey code that he won't know how to work at all.

Finally, congratulations Lucas for the time passed...

1 Like

Oh well, there you go. It helps right, left... and it does stupid things!

 

(Just kidding, PL ;-) )

1 Like

No more mistakes!

 

So already that, great, but, there's still a but... It doesn't get the variable "TYPE3 it gives me 1 every time.

 

So I looked at my 3D. I created a "TYPE" property that is activated by following the excel file, but on the flat pattern configs the property disappears...

 

So I end up with T1 Lg 2560.dxf but T1 everywhere even if the line is excel T2

Yes, Bart.

Because as Lucas said in his previous message, he recovers the ownership of the file and not that of the configuration.

I had done this in the code posted earlier: See attachment


macro_export_famille_de_piece_dxf.txt
1 Like

Yes remrem, ok it's understood.

 

But your figure

 

Error = cusPropMgr.Get5("TYPE", True, Value_T, ResolvedValOut, wasResolved) 'Retrieves the value of the property "T" in the variable "Value_T"

 

Not working. :/

 

Undefined object variable or Wtih block variable

@Bart:

Have you also copied the necessary declarations?

1 Like

Yes, I think so.

 

Here is the full code


macro_final_bis.txt

Try this:


macro_export_famille_de_piece_dxf.txt
1 Like

I'm going to end up bald from tearing my hair out....

 

Set cusPropMgr = config. CustomPropertyManager

 

it crashes on config: variable not defined

 

 


z4f8h.png

That's it...

;-)

[Edit: ] Mine are white! :-)


macro_export_famille_de_piece_dxf.txt
2 Likes

Small error in the macro of @remrem the one in attachment should work!


macro-dxf-bart.txt
1 Like

Always the same mistake:

 

Set cusPropMgr = config. CustomPropertyManager

 

A variable or block object with not defined.

 

White hair, can it be dyed ;) Is a wig ugly:p

 

 

 

 

Lucas, I have an error here:

 

Error = cusPropMgr.Get5("TYPE", Value_T, True, ResolvedValOut, wasResolved) 'Retrieves the value of the property "T" in the variable "Value_T"

 

Incorrect argument or procedure appeal.

 

If you don't hate me at the end of the day, I'll be lucky! =)

 

 

Lucas:

For me you have to move "Set config = swModel.GetActiveConfiguration" and "Set cusPropMgr = config. CustomPropertyManager" in the loop since the config changes.


macro_export_famille_de_piece_dxf.txt
2 Likes

In your case Remrem

 

this line Set cusPropMgr = config. CustomPropertyManager

 

Error block with on defined.

 

And that when I put the 2 lines you said in the indicated place.

Okay @remrem! After that, it gets too sharp without testing in SolidWorks, I can see that tomorrow.

For the correction, you had used TYP as a variable in the name, while before you assigned the personal property TYPE to the variable VALUE_T, so I put VALUE_T back in the name :)

2 Likes