Sign in to follow this  
LMVUICHARD

Access to solid edge data

Recommended Posts

hello,
I have one question i dont have found any answer in the online documentation.


Is it possible with NetHook to have, without create any additionnal  geometry, the canonic datas of a solid edge?
- The type (Arc, Line, Nurbs…)
- And the data (Arc center, radius, plane or line ends) ?

In Mastercam, that's possible for exemple with analyze function, but is it possible to do the same in a Net Hook program and access to all of these data?

 

SolidEdge.JPG.fd1a4efecf02d87147daa5443e723070.JPGimage.png.1e34b8e6e3e2f1bd19dbb8fecc431974.png

Thanks in advance!

Share this post


Link to post
Share on other sites

 

Thank you very much for your quick answer, despite its content... decidedly, i'm a little bit unlucky with Net-Hook projects!

Have a nice day!

Share this post


Link to post
Share on other sites
1 hour ago, LMVUICHARD said:

 

Thank you very much for your quick answer, despite its content... decidedly, i'm a little bit unlucky with Net-Hook projects!

Have a nice day!

There is the ability to have the edge curves come into Mastercam if that option is turned on when the file is imported. If they are turned on and you have them does that help with what your trying to accomplish? 

Share this post


Link to post
Share on other sites

Yes, i know this option, but it create ALL edges in the model, for only few needed...

Cleaning and sorting after is not shorter compared to create some.

Create some edges it's not really a big deal, but it's make the application less "Fully native solid integrated"...

Many users, coming from CAD solid world, don't understand it be needed to create wireframe geometry before all...
 
But thank you for your proposal!!

Share this post


Link to post
Share on other sites

With the chook sdk you could set up a function like this to create solid edges at the desired depth

int CrtEdgCrvsTrgt(int num, MC_BYTE color, double LwrScnLmt, double UprScnLmt, long level)
{
	bool CreateEdges = true;

	SetMainLevel(level);

	bool succf = false; long num_curve_create = 0; SldTagArray sldFaces;


	PSBodyAskFaces(num, sldFaces); long fccnt = PSBodyAskFaces(num);

	for (long i = 0; i < fccnt; i++) {

		bool isfce1 = ps_is_face(sldFaces[i]); if (isfce1) {

			bool creasrf = false;

			DB_LIST_ENT_PTR ** eptrs; SldTagArray sldEdges; SldTagArray sldEdges2;

			int vertex0{}, vertex1{}; long num2 = PSFaceAskEdges(sldFaces[i], sldEdges); for (long i2 =

				0; i2 < num2; i2++) {

				bool isedg1 = ps_is_edge(sldEdges[i2]); if (isedg1) {

					long num2 = ps_get_edge_vertices(sldEdges[i2], &vertex0, &vertex1);

					bool isv1 = ps_is_vertex(vertex0); bool isv2 = ps_is_vertex(vertex1);

					if (isv1 && isv2) {
						p_3d p3d1{}; bool scf1 = ps_get_vertex_point(vertex0, p3d1);

						p_3d p3d2{}; bool scf2 = ps_get_vertex_point(vertex1, p3d2);

						p_3d pt1; view_to_view(p3d1, 1, 1, pt1);

						p_3d pt2; view_to_view(p3d2, 1, 1, pt2);

						if (scf1 == true && scf2 == true && pt1[2] < UprScnLmt && pt2[2] < UprScnLmt &&

							pt1[2] > LwrScnLmt && pt2[2] > LwrScnLmt) {

							creasrf = true;
						}
						else { creasrf = false; break; }
					}
				}
			}

			if (creasrf == true) {
				SldSetFaceColor(sldFaces[i], color); if (CreateEdges) {

					long num3 = PSFaceAskEdges(sldFaces[i], sldEdges2);

					for (long i3 = 0; i3 < num3; i3++) {
						bool isedg2 =

							ps_is_edge(sldEdges2[i3]); if (isedg2) {
							num_curve_create =

								ps_tag_to_mc_ents(sldEdges2[i3], 0);
						}
					}
				}

				if (num_curve_create != 0 && num_curve_create > 0) { succf = true; }

				return succf ? num_curve_create : 0;

				creasrf = false; //out of range



			}
		}
	}
	return succf ? num_curve_create : 0;
}

Also : see my post about creating c++/cli nethook entries to take advantage of chook functions while maintaing access to your .net code

Share this post


Link to post
Share on other sites

Big thank you for your contribution Peter!


For the moment, i'm just in exploration of the NetHook capabilities.
But what you write, and other tips you've posted gave me want to explore in addition on sdk and Chook...

I'm more used to Vb (Sorry…). But i hope i can understood quickly the C (++ and #) basics keys... at least i can try!

Now the problem for me is to find enough time to read, write and test between possibilities...

Thanks to you!

  • Like 1

Share this post


Link to post
Share on other sites

Telerik.com has a free vb.net to c# translator, you could use it to see what your vb.net code looks like in a c-type language!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us